Hi *Frederick Cheung*
Good Morning
I got the error:Template missing ...............
No increment stage..............and please help me...............
Thanks ®ards
Balaji.R
On 12/2/08, balaji rajagopal <[EMAIL PROTECTED]> wrote:
>
> Hi *Frederick Cheung*
>
> I use one controller+five tables+one detailed form( it includes five form
> or page).First page enter the data and click next button(get the data using
> session) and final to click save button to store all data to corresponding
> table.
>
> But controller page code
>
> --------------------------------------------------------------------------------------------------------------------------------
>
> class WizardController < ApplicationController
>
> def wizard
> if params[:stage].nil?
> @stage = 1
> @resort_basic = ResortBasic.new {}
>
>
> @resort_basic.resortclassid=params[:resortclass][:resortclassid]
> @resort_basic.resortname=params[:resortname]
> @resort_basic.resorttypeid=params[:resorttype][:resorttypeid]
> @resort_basic.seasonid=params[:seasontype][:seasontypeid]
> @resort_basic.website=params[:website]
>
> @resort_basic.save()
>
> session[:resort_basicObj] = @resort_basic # Or whatever model is storing
> your stuff
>
>
> else if
>
> @stage = params[:stage].to_i
> @dummyObj = session[:resort_basicObj]
>
> @dummyObj.save()
>
>
> @resort_contactdetail = ResortContactdetail.new{}
>
> @[EMAIL PROTECTED]
>
> @resort_contactdetail.firstname= params[:firstname]
> @resort_contactdetail.lastname= params[:lastname]
> @resort_contactdetail.designation= params[:designation]
> @resort_contactdetail.email_id= params[:email_id]
> @resort_contactdetail.mobile= params[:mobile]
> @resort_contactdetail.telephone1= params[:telephone1]
> @resort_contactdetail.telephone2= params[:telephone2]
> @resort_contactdetail.fax= params[:fax]
>
> @resort_contactdetail.save()
>
> session[:resort_contactdetailObj] = @resort_contactdetail
>
> else if
>
> @stage = params[:stage].to_i
> @dummyObj1 = session[:resort_contactdetailObj]
>
> @dummyObj1.save()
>
> @resort_address = ResortAddress.new{}
>
> @[EMAIL PROTECTED]
>
> @resort_address.street= params[:street]
> @resort_address.area= params[:area]
> @resort_address.districtid= params[:district][:districtid]
> @resort_address.cityid= params[:city][:cityid]
> @resort_address.stateid= params[:state][:stateid]
> @resort_address.countryid= params[:country][:countryid]
> @resort_address.pincode= params[:pincode]
>
> @resort_address.save()
>
> session[:resort_addressObj] = @resort_address
>
> else if
>
> @stage = params[:stage].to_i
> @dummyObj2 = session[:resort_addressObj]
>
> @dummyObj2.save()
>
> @resort_additionaldetail = ResortAddtionaldetail.new{}
>
> @[EMAIL PROTECTED]
>
> @resort_additionaldetail.aminity= params[:aminity]
> @resort_additionaldetail.directions= params[:directions]
> @resort_additionaldetail.transport= params[:transport]
> @resort_additionaldetail.map= params[:map]
> @resort_additionaldetail.pickupoffered= params[:pickupoffered]
> @resort_additionaldetail.email_id= params[:email_id]
>
>
> @resort_additionaldetail.save()
>
> session[:resort_additionaldetailObj] = @resort_additionaldetail
>
> else
>
> @stage = params[:stage].to_i
> @dummyObj3 = session[:resort_additionaldetailObj]
>
> @dummyObj3.save()
>
> @resort_accomodation = ResortAccomodation.new{}
>
> @[EMAIL PROTECTED]
>
> @resort_accomodation.roomtypeid= params[:roomtype][:roomtypeid]
> @resort_accomodation.singleoccupancyrate= params[:singleoccupancyrate]
> @resort_accomodation.doubleoccupancyrate= params[:doubleoccupancyrate]
> @resort_accomodation.extrapersoncost= params[:extrapersoncost]
> @resort_accomodation.numberofrooms= params[:numberofrooms]
> @resort_accomodation.availablerooms= params[:availablerooms]
>
>
> @resort_accomodation.save()
>
> end
>
> @next_stage = @stage + 1
>
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> = session[:wizard_data]
>
> render :template => 'wizard\\stage'[EMAIL PROTECTED]
> end
> end
> end
> end
> end
>
> I got the error:Template missing ...............
>
> No increment stage..............and please help me...............
>
> Thanks ®ards
>
> Balaji.R
>
>
> On 12/2/08, balaji rajagopal <[EMAIL PROTECTED]> wrote:
>>
>> Hi *Frederick Cheung*
>> Good Evening...........
>>
>> Your Guideness very useful for me and I got the combo box id value.....
>>
>> Thank you sir...........
>>
>>
>> Thanks & Regards
>> Balaji.R
>>
>>
>> On 12/2/08, Frederick Cheung <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
>>> 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
-~----------~----~----~----~------~----~------~--~---