Displaying 5 results from an estimated 5 matches for "timeentri".
Did you mean:
timeentry
2013 Mar 04
2
accepts_nested_attributes: undefined method 'association'_attributes
I have 2 models Timesheet and TimeEntry:
class Timesheet < ActiveRecord::Base
attr_accessible :status, :user_id, :time_entries_attributes
has_many :time_entries, dependent: :destroy
accepts_nested_attributes_for :time_entries, :reject_if => proc {
|attributes| attributes[''worktime''].blank? }
end
class TimeEntry < ActiveRecord::Base
attr_accessible :task_id,
2013 Mar 30
1
How to use group in nested associations
The below query fails:
Timesheet.joins(:time_entries).select("timesheets.*,
sum(time_entries.worktime) as total").group("timesheets.start_date")
The models have the following relations:
Timesheet < AR
has_many :activities, dependent: :destroy, inverse_of: :timesheet
has_many :time_entries, through: :activities
accepts_nested_attributes_for :activities,
2005 Sep 28
0
search engine, select the selected option
hey, i have a search engine that let u search on the an employee
how can i make that if the user select "employee1" , on the next page
"employee1" is selected
this is my code (rhtml)
<tr>
<td><label for="employee_id">Employee</label></td>
<td colspan="3"><%= select "employee", "id",
2006 Sep 20
2
Not receiving form data using form_remote_for
Hi.
I''m having a problem that I am sure there is a simple solution for, but
I can''t see it.
I have the following partial:
<% form_for :time_entry, TimeEntry.new,
:url => hash_for_time_entries_url(:period => @period, :action =>
''new''),
:html => { :id => ''time-entry-form'' } do |f| %>
<table border="0"
2006 Nov 04
0
Controller don''t receives form parameters using form_remote_for
Hi.
I''m having a problem that I am sure there is a simple solution for, but
I can''t see it.
I have the following partial:
<% form_for :time_entry, TimeEntry.new,
:url => hash_for_time_entries_url(:period => @period, :action => ''new''),
:html => { :id => ''time-entry-form'' } do |f| %>
<table border="0"