I want all my pages in a 2.3 Rails app to have a URL with a prefix:
www.example.com/app/
and I wrote in the routes.rbfollowing lines:
map.root :appl => "app", :controller => "home"
map.connect ':appl/:controller/:action/:id'
map.connect ':appl/:controller/:action/:id.:format'
Everything works fine except map.resourceswhere I have
map.resources :pages
and now wherever I have edit_page_pathor page, the generated url is incorrect, because it is appnot inserted at the beginning. I tried with namespaceand scope, as I saw here in chapter 2.6 , but without success.
How should I do it? Is :applroutes a bad idea?
source
share