开发者

Scoped match routes in Rails

开发者 https://www.devze.com 2023-01-18 13:55 出处:网络
Is it possible to set scope for match routings. I have tried this: scope \"/admin\" do match \':controller/:action/:id\'

Is it possible to set scope for match routings.

I have tried this:

scope "/admin" do 
  match ':controller/:action/:id' 
emd

But it doesn开发者_高级运维't work.


Should be something like:

scope "/admin" do 
  match ':controller/:action/:id', :to => 'home#index', :via => 'get'
end

You have to match something TO something else… The :via method definition isn't mandatory.

EDIT

You may also try

scope "/admin" do 
  match '/:controller(/:action(/:id))' 
end
0

精彩评论

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