Rails: Associations I --- Local project

I followed the lesson, copying the code locally on Sublime Text. It seems as if not all the data from seeds.rb is loading because I can only access the “Beaches” tag without any destinations. As a result, I cannot do anything more than click “Learn more” to view an empty “Beaches” page.

Side note-- I am following the lesson virtually because each time I visit http://localhost:8000, I am directed to a blank page that just states “Not Found”

Hi @rachelbari,

I’d appreciate it if you’d post a link to the exercise you’re on. Regarding the in-exercise browser not loading anything, is that fixed if you visit https://localhost:8080 instead? If you file a support request in the section below the instructions, the Codecademy staff will work on fixing it.

I’m not sure why it didn’t seem to seed properly, though. Could you run rake db:seed again and let me know what the output is? It may be that doing it a second time will fix it, or that you’re getting an error that might explain what’s happening.

Here is the link to Associations I on Learn Ruby on Rails: https://www.codecademy.com/courses/learn-rails/lessons/one-many/exercises/one-many-adding-data?action=lesson_resume

Unfortunately, https://localhost:8080 did not work either (unless I am doing something wrong)

I ran rake db:seed twice again and it actually created another Tag for Beaches each time.

@rachelbari Thanks, I can’t load the page either so I’ve filed a bug with the support team.

I ran rake db:seed twice again and it actually created another Tag for Beaches each time.

Sorry about that, if you’d like, you can delete the old database and create with a new (empty) one with:

$ rake db:drop; rake db:create; rake db:migrate;

Are your destinations associated with tags? They should have a tag_id attribute, like this:

t1 = Tag.create(title: "...", image: "...")
                                                                # ↓ this
Destination.create(name: "...", description: "...", image: "...", tag_id: t1.id)

From what I can see of your code in the first screenshot, everything looks OK. It appears that it’s stopping seeding the database right after creating the first tag, though. Do you get any error messages in the terminal after running rake db:seed?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.