I have a category model and in my routes.rb, I have
resources :categories
which generates the following set of routes.
categories_path GET /categories(.:format) categories#index
POST /categories(.:format) categories#create
new_category_path GET /categories/new(.:format) categories#new
edit_category_path GET /categories/:id/edit(.:format) categories#edit
category_path GET /categories/:id(.:format) categories#show
PATCH /categories/:id(.:format) categories#update
PUT /categories/:id(.:format) categories#update
DELETE /categories/:id(.:format) categories#destroy
Now, what I need is except for all GET routes, I want the rest of the routes to be under ‘/admin’ scope. So that operations like create, edit and delete are accessed at admin/categories/:id/edit etc.
Is there an easy way to mention this scope?