lynco / GetThroughThis

https://mysterious-chamber-6439.herokuapp.com/
MIT License
1 stars 0 forks source link

Create Rake Task for Sample Nav Bar Entries #6

Closed sunnyrjuneja closed 10 years ago

siruguri commented 10 years ago

I was just going to pull these lines from db/seeds.rb - can you run it in your console to get the navbar to show up?

from db/seeds.rb

navbar_entries = [{title: "Home", url: "/"}, {title: "About Us", url:"/cms/pages/about"}, {title: "FAQ", url: "/"}, {title: "For Developers",url: "/"}]
navbar_entries.each do |entry|
    NavbarEntry.find_or_create_by(title: entry[:title]) do |rec|
        rec.url=entry[:url]
    end
end

Don't worry about the target routes for those links, it doesn't matter if they 404 on you.

sunnyrjuneja commented 10 years ago

I didn't realize you modified db/seeds.rb. I just ran rake db:seed and it worked perfectly. Thanks!