11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

routes.rb - namespace/scope module:/scope

Posted at

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
11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?