views:

35

answers:

1

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.

+1  A: 

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
Yannis
It seems that this doesn't work and it is impossible to combine scope with match.
Alexey Zakharov
I was wrong, it works. It even works using namespace instead of scope. Thank you Yannis you save my day.
Alexey Zakharov