Reputation: 1239
match '/submit_expense/:id' => 'expenses#submit_expense', :as => 'submit_expense'
How would I direct this to my :admin namespace? Do I have to define the match inside the namespace declaration?
Upvotes: 14
Views: 16094
Reputation: 4182
You also can just use to:
directive like this:
get '/submit_expense/:id', to: 'admin/expenses#submit_expense'
Upvotes: 4
Reputation: 483
You can just use / like when you use the controller generator:
match '/submit_expense/:id' => 'admin/expenses#submit_expense', :as => 'submit_expense'
Upvotes: 28
Reputation: 14018
in routes.rb
this might work...
namespace :admin do
match '/submit_expense/:id' => 'expenses#submit_expense', :as => 'submit_expense'
end
Upvotes: 12