I'm building admin panel for one web app开发者_Go百科lication and I've created admin folder in controllers, view, helpers folder. The problem is that I want this url (http://localhost:3000/admin/:controller/:action/:id) to be mapped from the specified controller action id in the admin folder. By using the code bellow in routes I have to specify every controller and I can't use customs actions. Can someone help with that issue ? My routes.rb is:
namespace :admin do
resources :products, :comments, :news
end
Just look it up:
match ':controller(/:action(/:id))', :controller => /admin\/[^\/]+/
精彩评论