jfjfjf
#1
I have the following code in my controller to update some data;
dd = DueDate.find(@sales_order.due_date.id)
dd.update_attributes = params[:DueDate]
But I get the following error when I try to run it?
undefined method `update_attributes=' for #<DueDate:0x45b6040>
What’s going on here? update_attributes is part of active record,
right?
I’d appreciate any help I can get…
Thanks!
jfjfjf
#2
I just tried the following and it worked:
dd = DueDate.update(@sales_order.due_date.id,
params[:DueDate])
Why does the update_attributes method not work?
jfjfjf
#3
On 5/23/07, jf [email protected] wrote:
What’s going on here? update_attributes is part of active record,
right?
It sure is! But, #update_attributes= is not.
dd.update_attributes(params[:DueDate])
–
Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com
jfjfjf
#4
dd.update_attributes(params[:DueDate])
I think the line above should be dd.update_attributes(:duedate =>
params[:DueDate]). You have to specify the field to update i think.
Eric Sheu