Jens Tinfors
2006-Mar-08 22:47 UTC
[Rails] List and update values from text_field_tag fields
Hi, I populate a couple of text_field_tag''s with data from an AciveRecord object. Some fields are editable and at the end of the page there''s a submit button. I want the new values to be updated in the DB but by default my original values are stored again. How do i go about doing this? thanks/jens AIM: jens.tinfors@mac.com Skype: jtinfors
Norman Timmler
2006-Mar-09 09:30 UTC
[Rails] List and update values from text_field_tag fields
Am Mittwoch, den 08.03.2006, 23:47 +0100 schrieb Jens Tinfors:> Hi, > > I populate a couple of text_field_tag''s with data from an AciveRecord > object. Some fields are editable and at the end of the page there''s a > submit button. I want the new values to be updated in the DB but by > default my original values are stored again. > How do i go about doing this? >Why don''t you want your unchanged values stored again? -- Norman Timmler blog.inlet-media.de
Jens Tinfors
2006-Mar-09 10:07 UTC
[Rails] List and update values from text_field_tag fields
ohh, i dont mind the unchanged values stored again. My problem (and its probably a very basic such) is how do i get the newly entered values from the text_field_tag''s back into the db? thanks/jens On 3/9/06, Norman Timmler <lists@inlet-media.de> wrote:> > Am Mittwoch, den 08.03.2006, 23:47 +0100 schrieb Jens Tinfors: > > Hi, > > > > I populate a couple of text_field_tag''s with data from an AciveRecord > > object. Some fields are editable and at the end of the page there''s a > > submit button. I want the new values to be updated in the DB but by > > default my original values are stored again. > > How do i go about doing this? > > > > Why don''t you want your unchanged values stored again? > > -- > Norman Timmler > > blog.inlet-media.de > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails >-- AIM/.Mac: jtinfors@mac.com ICQ: 123936751 Jabber: jens.tinfors@gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: wrath.rubyonrails.org/pipermail/rails/attachments/20060309/65ede0e1/attachment.html
Norman Timmler
2006-Mar-09 11:03 UTC
[Rails] List and update values from text_field_tag fields
Am Donnerstag, den 09.03.2006, 11:06 +0100 schrieb Jens Tinfors:> ohh, i dont mind the unchanged values stored again. > My problem (and its probably a very basic such) is how do i get the > newly entered values from the text_field_tag''s back into the db? > > thanks/jens > > On 3/9/06, Norman Timmler <lists@inlet-media.de> wrote: > Am Mittwoch, den 08.03.2006, 23:47 +0100 schrieb Jens Tinfors: > > Hi, > > > > I populate a couple of text_field_tag''s with data from an > AciveRecord > > object. Some fields are editable and at the end of the page > there''s a > > submit button. I want the new values to be updated in the DB > but by > > default my original values are stored again. > > How do i go about doing this? > > > > Why don''t you want your unchanged values stored again?Ok, i see. # code in your e.g. project controller def update @project = Project.find(params[:project][:id]) if @project.update_attributes(params[:project]) flash[:notice] = ''Project updated'' redirect_to :action => ''list'' else render :action => new end end Perhaps you want to use the scaffold generator to generate some sample code to see how everything works together. Maybe you should follow a Rails tutorial like: rails.homelinux.org -- Norman Timmler blog.inlet-media.de