rails routes for permalink with namespaced class
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-04-20T18:01:27Z
Indexed on
2010/04/20
18:03 UTC
Read the original article
Hit count: 346
this one in my routes works perfectly:
map.connect ':permalink', :controller => 'pages', :action => 'show'
for this class:
class PagesController < BackendController and on /xxx/pages it is shown like this:
<%= link_to "#{item.link_name}", {:controller => :pages, :action => :show, :permalink => item.permalink} %>
which will generate a link like "how-to-create-permalinks". but i decided to move the PagesController into a subdirectory so the class is now written like so:
class Backend::PagesController < BackendController
But how does the route look like now? And how do i display it on the template so it links using the permalink?
Thanks!
© Stack Overflow or respective owner