routes - Rails routing for nested controller's catch-all -


in rails 3, how make controllers/actions including nested controllers work without specifying them in routes.rb?

i uncommented following line, doesn't work nested controller.

match ':controller(/:action(/:id(.:format)))' 

i want make /preview/draft1/index work.

thanks.

sam

you need make route contraint on controller:

match ':controller(/:action(/:id(.:format)))', :controller => /preview\/[^\/]+/ 

where "preview" name of namespace.

and then:

match ':controller(/:action(/:id(.:format)))' 

for more info: http://edgeguides.rubyonrails.org/routing.html#dynamic-segments


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -