Jadeler Amin
2006-Oct-02 22:10 UTC
Retrieving value in controller - NoMethodError (undefined method `35='' for #<TimesheetItem:0x8ddda08>):
How can I retrieve the values in my controller for the text field
below? The "35" is the id of the item I want to update.
<input type="text" id="timesheet_item_35_work_category"
name="timesheet_item[35][work_category]" value="PROJECTS"
/>
My controller is:
def update
@timesheet = Timesheet.find(params[:id])
@timesheet.timesheet_items.build(params[:timesheet_item])
@timesheet.update_attributes(params[:timesheet])
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
