Hi, Ive just downloaded and installed Ruby on Rails, on a windows xp machine. Then I tried the cookbook tutorial, and get NoMethodError in Recipe#New when I try http://localhost:3000/recipe/new/. I could not figure out the problem so I tried another tutorial, the todo list one, and the same thing happens(NoMethodError in todo#list when I try http://localhost:300/todo/ . Both of these occur right after the step where I add scaffold :todo, or scaffold :recipe in the controller. So, I figure my scaffold isnt getting built. Is this what it means? What can I do about it. I want to get into Ruby on Rails, but am stuck for now on the threshold. TIA, S _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Dec 8, 2005, at 9:41 PM, Sharon Phelps wrote:> Hi, > > > > I’ve just downloaded and installed Ruby on Rails, on a windows xp > machine. Then I tried the cookbook tutorial, and get NoMethodError > in Recipe#New when I try http://localhost:3000/recipe/new/. I could > not figure out the problem so I tried another tutorial, the todo > list one, and the same thing happens(NoMethodError in todo#list > when I try http://localhost:300/todo/ . Both of these occur right > after the step where I add scaffold :todo, or scaffold “:recipe in > the controller. So, I figure my scaffold isn’t getting built. Is > this what it means? What can I do about it. I want to get into Ruby > on Rails, but am stuck for now on the threshold.Hi Sharon, If you want to rule out the scaffolding as the problem, try making a simple method like this (no view code or file necessary): class RecipeController < Application def test render :text => "Testing... testing..." end end Also, check the logs and you''ll probably find more information there. I usually use the ''tail'' command on unix systems to continuously show me the log file while I develop. If there''s no equivalent on XP, just open /log/development.log and see what you get in there. Duane Johnson (canadaduane) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi, I''m getting NoMethodError when I''m trying to save to the database. Here is the error. NoMethodError in Person#create undefined method `login'' for #<Person:0x378b728> The error points to the below def. If I remove the if @person.save statements, it will run through it without an error. def create @person = Person.new(params[:person]) if @person.save flash[:notice] = ''Person was successfully created.'' redirect_to :action => ''list'' else render :action => ''new'' end end Hope someone can help. Thanks in advance. -- Posted via http://www.ruby-forum.com/.
Hi, You need to provide more information for us to be able to provide you with a useful answer. I would suggest sending along snippets relevent Person model, SQL DDL for persons table and a stack trace. However I suspect that the error you are receiving is because you are trying to validate a column that does not exist in you database or in your model. -- Cheers, Peter Donald Blog: http://www.RealityForge.org On 12/10/05, oreo <raymondsiu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m getting NoMethodError when I''m trying to save to the database. Here > is the error. > NoMethodError in Person#create > undefined method `login'' for #<Person:0x378b728> > > The error points to the below def. If I remove the if @person.save > statements, it will run through it without an error. > > def create > @person = Person.new(params[:person]) > if @person.save > flash[:notice] = ''Person was successfully created.'' > redirect_to :action => ''list'' > else > render :action => ''new'' > end > end
awesome - you were correct. login was a field that was no longer being used. Thanks!!! -- Posted via http://www.ruby-forum.com/.
sharon wrote:> Hi, > > I�?ve just downloaded and installed Ruby on Rails, on a windows xp > machine. > Then I tried the cookbook tutorial, and get NoMethodError in Recipe#New > when > I try http://localhost:3000/recipe/new/. I could not figure out the > problem > so I tried another tutorial, the todo list one, and the same thing > happens(NoMethodError in todo#list when I try > http://localhost:300/todo/ . > Both of these occur right after the step where I add scaffold :todo, or > scaffold �?:recipe in the controller.Rails 2.x no longer has scaffold as a controller method. You are following an old tutorial. If you''re using Rails 2.3 (and I hope you are), try the tutorials at http://guides.rails.info . Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.