Refinery 2.0 Routes

76 views
Skip to first unread message

Mike S

unread,
May 15, 2012, 11:29:15 AM5/15/12
to Refinery CMS
So I've added a couple custom routes to my config/routes.rb file. They
show up when I do a rake routes, but none of the work in my app.
Example:

Routes.rb

mount Refinery::Core::Engine, :at => '/'

root :to => 'pages#home'
match 'cache' => 'application#clear_cache'
match 'HowToLIVEUNITED' => 'application#flash_fix'

rake routes give me:


refinery / Refinery::Core::Engine
root / pages#home
cache /cache(.:format) application#clear_cache
HowToLIVEUNITED /HowToLIVEUNITED(.:format)
application#flash_fix

But if I try to go to /cache or /HowToLIVEUNITED all I get is Sorry,
Page not found.

What's going on here?

Philip Arndt

unread,
May 15, 2012, 6:17:15 PM5/15/12
to refine...@googlegroups.com
You have to route custom routes *before* mounting Refinery otherwise Refinery will throw up its 404 logic. :-)

James Thompson

unread,
May 16, 2012, 3:08:24 AM5/16/12
to refine...@googlegroups.com
Thanks for answering this question - I've been running into this occasionally and have been pulling out my hair :-)
Reply all
Reply to author
Forward
0 new messages