Hi , I''m getting "undefined method `model'' for ContactController:Class" Basically this is my first RoR application. Can you please somebody help to resolve this. Steps I have followed, 1)ruby script/generate model contact 2)ruby script/generate controller contact 3) vim app/controllers/contact_controller.rb class ContactController < ApplicationController model :contact scaffold :contact end 4)ruby script/server -p 9090 Actually I need to create/select/update table thru RoR. Advance Thanks, Sankar. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
leave out the line model :contact you don''t need that. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sankar Kumar
2009-Feb-24 15:39 UTC
Re: undefined method `model'' for ContactController:Class
MaD wrote:> leave out the line > model :contact > you don''t need that.I have remove that .... Now I''m getting error like "undefined method `scaffold'' for ContactController:Class" I think i''m totally wrong .... Can you pls let me know the step to prepare small application ? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
sorry i didn''t read carefully enough. try this: rails project cd project script/generate scaffold contact name:string street:string mail:string nano config/database.yml rake db:migrate script/server firefox http://localhost:3000/contacts/new hope this helps. btw: the tutorial you are following seems outdated (pre rails 2.0) --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Feb-24 16:32 UTC
Re: undefined method `model'' for ContactController:Class
On 24 Feb 2009, at 15:39, Sankar Kumar wrote:> > MaD wrote: >> leave out the line >> model :contact >> you don''t need that. > > I have remove that .... Now I''m getting error like "undefined method > `scaffold'' for ContactController:Class" > > I think i''m totally wrong .... Can you pls let me know the step to > prepare small application ?Sounds like you''re trying to do an out of date tutorial. You will probably save yourself some frustration by picking a more up to date one. Fred> > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sankar Kumar
2009-Feb-25 03:25 UTC
Re: undefined method `model'' for ContactController:Class
MaD wrote:> sorry i didn''t read carefully enough. > > try this: > rails project > cd project > script/generate scaffold contact name:string street:string > mail:string > nano config/database.yml > rake db:migrate > script/server > firefox http://localhost:3000/contacts/new > > hope this helps. > > btw: the tutorial you are following seems outdated (pre rails 2.0)Thanks a lot . Thank you so much ... Now I''m able to do create/select/update table.... -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---