10

Invalid route name, already in use 'page'

 3 years ago
source link: https://fuzzyblog.io/blog/rails/2016/12/29/invalid-route-name-already-in-use-page.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Invalid route name, already in use 'page'

Dec 29, 2016

It seems that whenever you start a new Rails project you hit some kind of wackiness with respect to an error message that you've never seen before. Yesterday I started a new project and I wanted to use Bootstrap for my layout. Well I couldn't make it work and then Dv couldn't make it work so I finally turned to the RailsApps project and used their bootstrap template app. And that worked so Huzzah! both for them and me. Thanks Guys!

Note: Dv and I have both used bootstrap on I can't tell you how many different sites and its always a pain in the neck to initially get going. We were using the bootstrap gem and we had the scss stuff configured correctly at least by comparing to a reference site.

Today I integrated authlogic for authentication based on a SitePoint AuthLogic tutorial. When I generated a Pages Controller and dropped a resources :pages into my routes file I got this:

Invalid route name, already in use: 'page' 

My routes file right now is like 5 lines so I was actually certain that I didn't have pages in there already (embarrassingly though I did do a command+F anyway). A bunch of googling turned up this answer. Apparently the High Voltage gem from Thoughtbot automagically inserts its pages route into the routes file. And I get the desire for simplicity but when it doesn't even require a declaration in the Gemfile it makes tracking this kind of stuff down annoying. Sigh.

Once that was removed then I was able to get my static pages working again so that's nice. And I like what the High Voltage gem is actually doing.


Posted In: #rails #pages #authlogic #bootstrap


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK