On 2 Dec 2008, at 10:18, balaji rajagopal wrote:
> > Hi > > Textbox coding in controller > > @resort_basic.resortname=params[:resortname]; > > is working well and i got the value....................... > > > Combo box coding in controller > > 1. @resort_basic.resortclass[resortclassid]=params[:resortclass]; > > got error in 1st code : undefined method `resortclass' for > #<ResortBasic:0x5ba21a> > > 2. @resort_basic.resortclassid=params[:resortclass[resortclassid]]; > > got error in 2nd code :undefined local variable or > method`resortclassid'for #<WizardController:0x7310db> > > 3. @resort_basic.resortclassid=params[:resortclass]; > > got error in 3rd code :id value stored in 1 but id value is not > store 2 > > correct id value is 2........................ This is really super basic ruby - you'll be wasting a lot of time if you don't go back and read the basics. It should be obvious from what's below that params[:resortclass][:resorttypeid] grabs the right parameter id. You're also creating rather more work for your self than you need. Get it right and you can just do resort_basic = ResortBasic.new params[:resort_basic]. http://guides.rubyonrails.org/form_helpers.html has some details on that, also see the documentation for form_for etc... Fred > > so please help me sir.......... > > Thanks &Regards > balaji.R > > On 12/2/08, Frederick Cheung <[EMAIL PROTECTED]> wrote: > > > On Dec 2, 5:36 am, "balaji rajagopal" <[EMAIL PROTECTED]> > wrote: > > > > > *Parameters*: > > > > {"authenticity_token"=>"ad873f6fad6c67d5457b476d1130c5a966d74684", > > "resortname"=>"mahapalipuram ", > > "resorttype"=>{"resorttypeid"=>"2"}, > > "resortclass"=>{"resortclassid"=>"2"}, > > "seasontype"=>{"seasontypeid"=>"2"}, > > "website"=>"www.mpm.com", > > "commit"=>"Next"} > > > > The answer is right here. params[:resortname] exists, but params > [:resorttypeid] doesn't - it's inside params[:resorttype] (because > that's what the select helper you're using does) > > Fred > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

