# Saving ActiveRecord/form changes

**URL:** <https://www.ruby-forum.com/t/saving-activerecord-form-changes/158742>\
**Category:** Ruby\
**Created:** [January 27, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/saving-activerecord-form-changes/158742 "2009-01-27T15:28:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bburcham](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f9ae1b/32.png) [@bburcham](https://www.ruby-forum.com/u/bburcham)\
**Post date:** [January 27, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/saving-activerecord-form-changes/158742/1 "2009-01-27T15:28:38Z")

</div>

Greetings everyone,

I can’t pass updated/changed values from the form elements to the  
ActiveRecord. However something is going through because the table’s  
update\_when column is registering the date/time of the update, but  
otherwise no data revisions transpire. Have tried using form\_for helper  
as well, but the same results.

This is all new to me, so not sure what additional info will be  
relevant. But am using Ruby 1.8.6 with a local MYSQL 5.1 database thru  
a Radrails IDE. My apologies for whatever info I have ommitted. Any  
suggestions on where I have gone astray will be most appreciated.

Thanks, Bill

CONTROLLER:

class FileController \< ApplicationController

def edit  
@file = File.find(params[:id])  
end

def update  
@file = File.find(params[:id])  
if @file.update\_attributes(params[:file])  
redirect\_to :action =\> ‘show’, :id =\> @file  
else  
render :action =\> ‘edit’  
end  
end  
end

VIEW:

\<% form\_tag (:action =\> ‘update’, :id =\> @file.id) do %\>

Description  
\<%= text\_area 'file', 'description'

\<%= submit\_tag ‘Save changes’ %\>  
\<% end %\>

\<%= link\_to ‘Back’, {:action =\> ‘list’} %\>

---

<div class="post-metadata">

**Author:** ![bburcham](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f9ae1b/32.png) [@bburcham](https://www.ruby-forum.com/u/bburcham)\
**Post date:** [January 27, 2009, 3:55pm UTC](https://www.ruby-forum.com/t/saving-activerecord-form-changes/158742/2 "2009-01-27T15:55:58Z")

</div>

I’m afraid the Rails mailing lists/groups are elsewhere. This is the  
Ruby programming language list.

However, as a quick guess: you should either be using form\_tag with  
text\_area\_tag, or form\_for with text\_area. There are plenty of sample  
apps out there you can check against. Here’s the one that got me  
started:

> **[Radar - O’Reilly](https://www.oreilly.com/radar/)**
>
> Now, next, and beyond: Tracking need-to-know trends at the intersection of business and technology
