Displaying 1 result from an estimated 1 matches for "timesheetscontroller".
Did you mean:
timesheetcontroller
2013 Mar 04
0
fields_for with accepts_nested_attributes: how to pass a value to a label
I can''t figure out how to pass a value from the following object build in
the controller:
class TimesheetsController < AC
...
def new
@timesheet = current_user.timesheets.new
now = Date.today
#generating 7 time entries: monday through sunday
(now.beginning_of_week..now.end_of_week).step { |date|
@timesheet.time_entries.build(:workdate; date)
end
end
...
In the Timesheet model I defined ac...