Skip to content

Instantly share code, notes, and snippets.

@ppworks
Created January 28, 2013 07:20
Show Gist options
  • Save ppworks/4653612 to your computer and use it in GitHub Desktop.
Save ppworks/4653612 to your computer and use it in GitHub Desktop.
resourcesとresourceを組み合わせる際の注意点 ref: http://qiita.com/items/9b792c9bcb8bc4289066
rake routes
users GET /users(.:format) users#index
user GET /users/:id(.:format) users#show
edit_users GET /users/edit(.:format) users#edit
PUT /users(.:format) users#update
Failures:
1) UsersController routing /users routing /users CRUD routes to #edit
Failure/Error: get("/#{resources}/edit").should route_to("#{resources}#edit")
The recognized options <{"action"=>"show", "controller"=>"users", "id"=>"edit"}> did not match <{"controller"=>"users", "action"=>"edit"}>, difference: <{"action"=>"edit", "id"=>"edit"}>.
<{"controller"=>"users", "action"=>"edit"}> expected but was
<{"action"=>"show", "controller"=>"users", "id"=>"edit"}>.
rake routes
edit_users GET /users/edit(.:format) users#edit
users PUT /users(.:format) users#update
GET /users(.:format) users#index
user GET /users/:id(.:format) users#show
resource :users, only: [:edit, :update]
resources :users, only: [:index, :show]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment