Reputation: 6110
I am on listing 7.3, and am getting a no route error. I am very new to rails, so what other files can I provide to help debug by no route.
Here is my routes files
SampleApp::Application.routes.draw do
resources :users
root to: 'static_pages#home'
match '/signup', to: 'users#new'
match '/signup', to: 'users#new'
match '/help', to: 'static_pages#help'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
end
Upvotes: 0
Views: 1186
Reputation: 11
Got the same problem )
My mistake was resource :users
in routes.rb
But correct is resources :users
In first case you get GET /users(.:format) users#show
rake route output and can access your user throo url http://localhost:3000/users?id=1
In second case you get user GET /users/:id(.:format) users#show
rake route output and can access your user throo url http://localhost:3000/users/1
Upvotes: 1