OreApp::Application.routes.draw do
resources :services
get 'services/:id/normal' => 'services#normal'
get 'services/:id/maint' => 'services#maint'
get 'services/shanaiok' => 'services#shanaiok'
get 'services/shanaing' => 'services#shanaing'
root 'services#index'
end
rake routesの結果:
$ rake routes
Prefix Verb URI Pattern Controller#Action
services GET /services(.:format) services#index
POST /services(.:format) services#create
new_service GET /services/new(.:format) services#new
edit_service GET /services/:id/edit(.:format) services#edit
service GET /services/:id(.:format) services#show
PATCH /services/:id(.:format) services#update
PUT /services/:id(.:format) services#update
DELETE /services/:id(.:format) services#destroy
GET /services/:id/normal(.:format) services#normal
GET /services/:id/maint(.:format) services#maint
services_shanaiok GET /services/shanaiok(.:format) services#shanaiok
services_shanaing GET /services/shanaing(.:format) services#shanaing
root GET / services#index
OreApp::Application.routes.draw do
get 'services/shanaiok' => 'services#shanaiok'
get 'services/shanaing' => 'services#shanaing'
resources :services
get 'services/:id/normal' => 'services#normal'
get 'services/:id/maint' => 'services#maint'
root 'services#index'
end
rake routesの結果:
$ rake routes
Prefix Verb URI Pattern Controller#Action
services_shanaiok GET /services/shanaiok(.:format) services#shanaiok
services_shanaing GET /services/shanaing(.:format) services#shanaing
services GET /services(.:format) services#index
POST /services(.:format) services#create
new_service GET /services/new(.:format) services#new
edit_service GET /services/:id/edit(.:format) services#edit
service GET /services/:id(.:format) services#show
PATCH /services/:id(.:format) services#update
PUT /services/:id(.:format) services#update
DELETE /services/:id(.:format) services#destroy
GET /services/:id/normal(.:format) services#normal
GET /services/:id/maint(.:format) services#maint
root GET / services#index
前にも引っかかったことがあり、学習能力がないようです俺。。 orz
そして極めつけには、routes.rbの初期ファイル内コメントに
# The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes".