Question


I got a small problem. I'm new and reading through the guides on how to build a demo_app.
I started with '$ rails generate scaffold User name:string email:string'
After successfully generating the scaffold command;
I use '$bundle exec rake db:migrate'
I start rails server, and go to localhost:3000;
I try going to localhost:3000/users and it says [ROUTING ERROR -- No route matches [GET] "/users"]

what did i do wrong?
I've followed all the steps from the guides and it's suppose to show "the list of users"
Any Help is much appreciated..

Regards,
Marc

Was it helpful?

Solution

If your server was running before you generated the scaffold, then you should try to restart the server. Other than that please ensure the following line appears in your config/routes.rb

resources :users

I hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top