Created
July 28, 2015 03:53
-
-
Save june29/7749a5e5da8351b1e755 to your computer and use it in GitHub Desktop.
RailsのRoutingあれこれ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resources :users do | |
get '/image' => 'users#image', as: :image | |
end | |
end | |
=begin | |
user_image GET /users/:user_id/image(.:format) users#image | |
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 | |
=end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resources :users | |
get '/users/:id/image' => 'users#image', as: :user_image | |
end | |
=begin | |
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 | |
user_image GET /users/:id/image(.:format) users#image | |
=end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resources :users do | |
get '/image' => 'users#image', as: :image, on: :member | |
end | |
end | |
=begin | |
image_user GET /users/:id/image(.:format) users#image | |
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 | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment