I just ran into that same problem myself. The problem stems from the fact that you are manually pluralizing "users".
The line that is causing the problem is: script/generate scaffold users Username:string Password:String instead use the word "user" script/generate scaffold user Username:string Password:String I think Rails is getting confused with in its pluralization somewhere. Hope this helps. [email protected] wrote: > Clearly I'm doing something wrong, but should it really be this > difficult to figure out? > > I found the Rails 2.0 tutorial movie and did the following: > > rails ESPlanner_Web --d=mysql > > Edited database.yml appropriately > > script/generate scaffold users Username:string Password:String > > Tweaked the migrations to get the lengths right and added an index. > > rake db:migrate > > Checked via phpmyadmin that the tables got set up properly (they did). > > Modified routes.rb to start at the users controller. > Deleted public/index.html. > > script/server > > Hit localhost:3000 using Firefox and get: > > NameError in Users#index > > Showing users/index.html.erb where line #22 raised: > > undefined local variable or method `new_users_path' for > #<ActionView::Base:0x25013cc> > > Extracted source (around line #22): > > 19: > 20: <br /> > 21: > 22: <%= link_to 'New users', new_users_path %> > > By which I assume that the index method of the Users controller didn't > define new_users_path so I looked at that and see: > > def index > @users = Users.find(:all) > > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @users } > end > end > > presumably the format.html statement is magic that hits index.html.erb > which requires new_users_path to be defined but it isn't. > > Am I doing something wrong or is the scaffold generator broken? > > Best, > > Dick Munroe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

