problem in update

balaji rajagopal
Fri, 19 Dec 2008 04:29:01 -0000

Hi

im using five forms(5 pages) and one controller.select the edit form1 page
values displayed but i change values after updated but not change the values
in database .only already values stored.

view code
------------------------------
-----------------------------------------------------editresortadditionaldetails.html

<% form_tag :action =>
''update'',:controller=>''Wizard'',:id=>@id
do %>



Edit Resort Additional Detail

    <!--tr>

Resort



            <!--%=f.collection_select(:resortid,
ResortBasic.find(:all),:id,:resortname)%>

    </tr-->


Amenities


         <%=text_area_tag
@resort_additionaldetail.aminity,@resort_additionaldetail.aminity%>




Directions



            <%=text_field_tag
@resort_additionaldetail.directions,@resort_additionaldetail.directions %>




Transport


           <%=text_field_tag
@resort_additionaldetail.transport,@resort_additionaldetail.transport %>




Map



            <%=text_field_tag
@resort_additionaldetail.map,@resort_additionaldetail.map %>




Pickup Offered


           <%=text_field_tag
@resort_additionaldetail.pickupoffered,@resort_additionaldetail.pickupoffered
%>




Email



           <%=text_field_tag
@resort_additionaldetail.email_id,@resort_additionaldetail.email_id %>







            <%=submit_tag "Update" ,:class
=>''myButton'' %>







<% end %>


controller code


 def editresortbasics
   # render :text =>params[:resortname]

  # @resort_basic.resortname=params[:resortname]
     # logger.debug(params[:id])
 session[:editresort_id]=params[:id]
  @id = session[:editresort_id]
  @resort_basic =ResortBasic.find(@id)


  #if request.post?
  # @resort_basic.update_attributes(params[:resort_basic])
  #      flash[:notice] = ''Resort was successfully updated.''
  # redirect_to :action => ''editresortbasic'',
  session[:resort_basic]=@resort_basic
 # session[:editresort_id]=params[:id]
  render :action=> "editresortbasic"
 # redirect_to(@resort_contactdetail)
  end

  def editresortcontacts

  @id = session[:editresort_id]
   #render :text =>@id
   @resort_contactdetail =ResortContactdetail.find(@id)
     session[:resort_contact]=@resort_contactdetail
      render :action => "editresortcontact"
  end

  def editresortaddresses
    @id = session[:editresort_id]
    @resort_address =ResortAddress.find(@id)

    session[:resort_address]= @resort_address

   render :action => "editresortaddress"
  end
   def editresortaccomodations
      @id = session[:editresort_id]
     @resort_accomodation =ResortAccomodation.find(@id)
   session[:resort_accomodation]= @resort_accomodation
   render :action => "editresortaccomodation"
   end
  def editresortadditional
  @id = session[:editresort_id]
  @resort_additionaldetail =ResortAdditionaldetail.find(@id)
   render :action => "editresortadditionals"
  end

  def update

  # @resort_basic =ResortBasic.find(params[:id])
  # @resort_basic =  session[:resort_basic]
  # @resort_basic.update_attributes(params[:resort_basic])

   #@resort_contactdetail =ResortContactdetail.find(params[:id])
  # @resort_address =ResortAddress.find(params[:id])
  # @resort_accomodation =ResortAccomodation.find(params[:id])
   @resort_additionaldetail =ResortAdditionaldetail.find(params[:id])
  # render:text=>params[:id]
   #if request.post?

  # @resort_contactdetail =  session[:resort_contact]
   #@resort_contactdetail.update_attributes(params[:resort_contact])
  # @resort_address =  session[:resort_address]
  # @resort_address.update_attributes(params[:resort_address])
  # @resort_accomodation =  session[:resort_accomodation]
 #  @resort_accomodation.update_attributes(params[:resort_accomodation])

  if @resort_additionaldetail.update_attributes(params[:resort_additional])
    # render:text=>params[:resort_additional]
   # flash[:notice] = ''Add Resort was successfully updated.''
   render :action => "resortupdated"
 #redirect_to(@resort_additionaldetail)
  end

Values not updated in database.give idea and any one help for me

Thanks
Balaji

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---