From: Brian Candler Date: 2010-09-10T04:17:32+09:00 Subject: Re: File upload help Shef wrote: > I'm fairly new to rails Please note that Rails is not Ruby. Problems with Rails really belong on a Rails mailing list. But in this case I see your problem is here: > def corrections=(doc_field) > self.corrections = doc_field.to_s > end You've set up an infinite loop, of a method calling itself recursively, which in turn calls itself, which in turn calls itself... ad infinitum. Each call uses some memory, and so you must run out. If this is an Active Record model, then use read_attribute or write_attribute to have direct access to the underlying data. (Look up "Facade Columns" in the index if you have the Agile Web Development with Rails book) The non-Rails way to do what you want is something like this: alias :old_corrections= :corrections= def corrections=(doc_field) self.old_corrections = doc_field.to_s end But I'm not sure why you're doing this - ActiveRecord adds the corrections= accessor for you, and if it's a string column I'm fairly sure it will convert any value you pass into a string. So try leaving it out entirely. Brian. -- Posted via http://www.ruby-forum.com/.