1


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

levelone
  • 2,289
  • 3
  • 16
  • 17
  • That's strange. Given your steps, it sounds like you did the right things. Did the rake db:migrate run successfully? You should see some output that it called create_table(:users) and that it didn't throw an exception. – agmcleod Apr 04 '12 at 16:07
  • Can you paste here config/routes.rb? – AMIC MING Apr 04 '12 at 16:25
  • it was already at resources :users ... not sure why it didnt work the first time. i restarted my cpu and it works perfectly. thanks for the help guys. i appreciate it – levelone Apr 05 '12 at 14:07

1 Answers1

3

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.