namespace
namespace :admin do
resources :posts
end
↓
admin_posts_path GET /admin/posts(.:format) admin/posts#index
POST /admin/posts(.:format) admin/posts#create
new_admin_post_path GET /admin/posts/new(.:format) admin/posts#new
edit_admin_post_path GET /admin/posts/:id/edit(.:format) admin/posts#edit
admin_post_path GET /admin/posts/:id(.:format) admin/posts#show
PUT /admin/posts/:id(.:format) admin/posts#update
DELETE /admin/posts/:id(.:format) admin/posts#destroy
scope module:
scope module: "admin" do
resources :posts
end
↓
posts_path GET /posts(.:format) admin/posts#index
POST /posts(.:format) admin/posts#create
new_post_path GET /posts/new(.:format) admin/posts#new
edit_post_path GET /posts/:id/edit(.:format) admin/posts#edit
post_path GET /posts/:id(.:format) admin/posts#show
PUT /posts/:id(.:format) admin/posts#update
DELETE /posts/:id(.:format) admin/posts#destroy
scope
scope "/admin" do
resources :posts
end
↓
posts_path GET /admin/posts(.:format) posts#index
POST /admin/posts(.:format) posts#create
new_post_path GET /admin/posts/new(.:format) posts#new
edit_post_path GET /admin/posts/:id/edit(.:format) posts#edit
post_path GET /admin/posts/:id(.:format) posts#show
PUT /admin/posts/:id(.:format) posts#update
DELETE /admin/posts/:id(.:format) posts#destroy