Prefix Verb URI Pattern Controller#Action
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
users GET /users(.:format) users#index
Prefix Verb URI Pattern Controller#Action
users POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
user GET /users/:id(.:format) users#show
Prefix Verb URI Pattern Controller#Action
new_book GET /book/new(.:format) books#new
edit_book GET /book/edit(.:format) books#edit
book GET /book(.:format) books#show
PATCH /book(.:format) books#update
PUT /book(.:format) books#update
DELETE /book(.:format) books#destroy
POST /book(.:format) books#create
Prefix Verb URI Pattern Controller#Action
admin_users GET /admin/users(.:format) admin/users#index
POST /admin/users(.:format) admin/users#create
new_admin_user GET /admin/users/new(.:format) admin/users#new
edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
admin_user GET /admin/users/:id(.:format) admin/users#show
PATCH /admin/users/:id(.:format) admin/users#update
PUT /admin/users/:id(.:format) admin/users#update
DELETE /admin/users/:id(.:format) admin/users#destroy
Prefix Verb URI Pattern Controller#Action
new_admin_book GET /admin/book/new(.:format) admin/books#new
edit_admin_book GET /admin/book/edit(.:format) admin/books#edit
admin_book GET /admin/book(.:format) admin/books#show
PATCH /admin/book(.:format) admin/books#update
PUT /admin/book(.:format) admin/books#update
DELETE /admin/book(.:format) admin/books#destroy
POST /admin/book(.:format) admin/books#create
Prefix Verb URI Pattern Controller#Action
users GET /users(.:format) admin/users#index
POST /users(.:format) admin/users#create
new_user GET /users/new(.:format) admin/users#new
edit_user GET /users/:id/edit(.:format) admin/users#edit
user GET /users/:id(.:format) admin/users#show
PATCH /users/:id(.:format) admin/users#update
PUT /users/:id(.:format) admin/users#update
DELETE /users/:id(.:format) admin/users#destroy
Prefix Verb URI Pattern Controller#Action
new_book GET /book/new(.:format) admin/books#new
edit_book GET /book/edit(.:format) admin/books#edit
book GET /book(.:format) admin/books#show
PATCH /book(.:format) admin/books#update
PUT /book(.:format) admin/books#update
DELETE /book(.:format) admin/books#destroy
POST /book(.:format) admin/books#create
Prefix Verb URI Pattern Controller#Action
users GET /admin/users(.:format) users#index
POST /admin/users(.:format) users#create
new_user GET /admin/users/new(.:format) users#new
edit_user GET /admin/users/:id/edit(.:format) users#edit
user GET /admin/users/:id(.:format) users#show
PATCH /admin/users/:id(.:format) users#update
PUT /admin/users/:id(.:format) users#update
DELETE /admin/users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
new_book GET /admin/book/new(.:format) books#new
edit_book GET /admin/book/edit(.:format) books#edit
book GET /admin/book(.:format) books#show
PATCH /admin/book(.:format) books#update
PUT /admin/book(.:format) books#update
DELETE /admin/book(.:format) books#destroy
POST /admin/book(.:format) books#create
Prefix Verb URI Pattern Controller#Action
admin_users GET /users(.:format) users#index
POST /users(.:format) users#create
new_admin_user GET /users/new(.:format) users#new
edit_admin_user GET /users/:id/edit(.:format) users#edit
admin_user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
user_items GET /users/:user_id/items(.:format) items#index
POST /users/:user_id/items(.:format) items#create
new_user_item GET /users/:user_id/items/new(.:format) items#new
edit_user_item GET /users/:user_id/items/:id/edit(.:format) items#edit
user_item GET /users/:user_id/items/:id(.:format) items#show
PATCH /users/:user_id/items/:id(.:format) items#update
PUT /users/:user_id/items/:id(.:format) items#update
DELETE /users/:user_id/items/:id(.:format) items#destroy
new_user_book GET /users/:user_id/book/new(.:format) books#new
edit_user_book GET /users/:user_id/book/edit(.:format) books#edit
user_book GET /users/:user_id/book(.:format) books#show
PATCH /users/:user_id/book(.:format) books#update
PUT /users/:user_id/book(.:format) books#update
DELETE /users/:user_id/book(.:format) books#destroy
POST /users/:user_id/book(.:format) books#create
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
book_users GET /book/users(.:format) users#index
POST /book/users(.:format) users#create
new_book_user GET /book/users/new(.:format) users#new
edit_book_user GET /book/users/:id/edit(.:format) users#edit
book_user GET /book/users/:id(.:format) users#show
PATCH /book/users/:id(.:format) users#update
PUT /book/users/:id(.:format) users#update
DELETE /book/users/:id(.:format) users#destroy
new_book GET /book/new(.:format) books#new
edit_book GET /book/edit(.:format) books#edit
book GET /book(.:format) books#show
PATCH /book(.:format) books#update
PUT /book(.:format) books#update
DELETE /book(.:format) books#destroy
POST /book(.:format) books#create
resources :users, shallow: true do
# resource :bookがここにある場合、shallow: trueの有無に関係なく同じルーティングになる
# scope shallow_path: '...'やscope shallow_prefix: '...'がある場合は別
resources :items
end
# 別の書き方1
resources :users do
resources :items, shallow: true
end
# 別の書き方2
shallow do
resources :users do
resources :items
end
end
# 別の書き方3
resources :users do
resources :items, only: [:index, :new, :create]
end
resources :items, only: [:show, :edit, :update, :destroy]
Prefix Verb URI Pattern Controller#Action
user_items GET /users/:user_id/items(.:format) items#index
POST /users/:user_id/items(.:format) items#create
new_user_item GET /users/:user_id/items/new(.:format) items#new
edit_item GET /items/:id/edit(.:format) items#edit
item GET /items/:id(.:format) items#show
PATCH /items/:id(.:format) items#update
PUT /items/:id(.:format) items#update
DELETE /items/:id(.:format) items#destroy
Prefix Verb URI Pattern Controller#Action
user_items GET /shal/users/:user_id/items(.:format) items#index
POST /shal/users/:user_id/items(.:format) items#create
new_user_item GET /shal/users/:user_id/items/new(.:format) items#new
edit_item GET /shal/items/:id/edit(.:format) items#edit
item GET /shal/items/:id(.:format) items#show
PATCH /shal/items/:id(.:format) items#update
PUT /shal/items/:id(.:format) items#update
DELETE /shal/items/:id(.:format) items#destroy
new_user_book GET /shal/users/:user_id/book/new(.:format) books#new
edit_user_book GET /shal/users/:user_id/book/edit(.:format) books#edit
user_book GET /shal/users/:user_id/book(.:format) books#show
PATCH /shal/users/:user_id/book(.:format) books#update
PUT /shal/users/:user_id/book(.:format) books#update
DELETE /shal/users/:user_id/book(.:format) books#destroy
POST /shal/users/:user_id/book(.:format) books#create
Prefix Verb URI Pattern Controller#Action
shal_user_items GET /users/:user_id/items(.:format) items#index
POST /users/:user_id/items(.:format) items#create
new_shal_user_item GET /users/:user_id/items/new(.:format) items#new
edit_shal_item GET /items/:id/edit(.:format) items#edit
shal_item GET /items/:id(.:format) items#show
PATCH /items/:id(.:format) items#update
PUT /items/:id(.:format) items#update
DELETE /items/:id(.:format) items#destroy
new_shal_user_book GET /users/:user_id/book/new(.:format) books#new
edit_shal_user_book GET /users/:user_id/book/edit(.:format) books#edit
shal_user_book GET /users/:user_id/book(.:format) books#show
PATCH /users/:user_id/book(.:format) books#update
PUT /users/:user_id/book(.:format) books#update
Prefix Verb URI Pattern Controller#Action
user_foo GET /users/:user_id/foo(.:format) users#foo
preview_new_user GET /users/new/preview(.:format) users#preview
disable_user PATCH /users/:id/disable(.:format) users#disable
bulk_insert_users POST /users/bulk_insert(.:format) users#bulk_insert
new_user GET /users/new(.:format) users#new
Prefix Verb URI Pattern Controller#Action
bar_book GET /book/bar(.:format) books#bar
preview_new_book GET /book/new/preview(.:format) books#preview
disable_book PATCH /book/disable(.:format) books#disable
bulk_insert_book POST /book/bulk_insert(.:format) books#bulk_insert
new_book GET /book/new(.:format) books#new
Prefix Verb URI Pattern Controller#Action
users GET /users(.:format) admin/accounts#index
POST /users(.:format) admin/accounts#create
new_user GET /users/new(.:format) admin/accounts#new
edit_user GET /users/:id/edit(.:format) admin/accounts#edit
user GET /users/:id(.:format) admin/accounts#show
PATCH /users/:id(.:format) admin/accounts#update
PUT /users/:id(.:format) admin/accounts#update
DELETE /users/:id(.:format) admin/accounts#destroy
Prefix Verb URI Pattern Controller#Action
accounts GET /users(.:format) users#index
POST /users(.:format) users#create
new_account GET /users/new(.:format) users#new
edit_account GET /users/:id/edit(.:format) users#edit
account GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/make(.:format) users#new
edit_user GET /users/:id/change(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Prefix Verb URI Pattern Controller#Action
GET /users/:id(.:format) accounts#show
Prefix Verb URI Pattern Controller#Action
account GET /users/:id(.:format) accounts#show
Prefix Verb URI Pattern Controller#Action
account GET /users/:id(.:format) accounts#show
GET /accounts/:id(.:format) redirect(301, users/:id)
Prefix Verb URI Pattern Controller#Action
root GET / users#show
admin_root GET /admin(.:format) admin/users#show