开发者

routing problem for admin panel in rails 3

开发者 https://www.devze.com 2023-02-20 20:52 出处:网络
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/:co

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\/[^\/]+/
0

精彩评论

暂无评论...
验证码 换一张
取 消