Hi all,
Could any one help me how to edit all the timesheets at a time.
If i select the month as december, i should get all the timesheets from
the data base, I''m getting this one correctly, after getting this, i
should be able to edit these automatically all the timesheets.
Thisis my clear explanation::
if i search the list according to date i''ll get in the following way..
Created At Project Hours Worked Remarks
2006-09-18 Ruby 3 working good
2006-09-18 Ruby 5 not working good
and here it self i should be edited in the following way.
Created At Project Hours Worked Remarks
2006-09-18 Rails 3 working good
2006-09-18 Ruby 8 not working good
see project Ruby is changed to Rails and Hours Worked is changed to 8.
like i need to get the list and i should be able to edit there it self.
Please give any suggestions.
Following is my code::
See this is my controller::
def logic1
userId=@session[''user''][''id'']
user=User.find(userId)
@timesheets =
Timesheet.find(:all,:conditions=>[''month(created_at) ?'',
params[:timesheet][''created_at(2i)''].to_i]).map {|t| t.id }
end
VIEW::
<%= link_to "Home", :action=>"index"%>
<%= start_form_tag :action =>
''update'',:id=>@timesheets %>
<table border="1" bordercolor="black">
<tr>
<th>Created At</th>
<th>Project</th>
<th>Hours Worked</th>
<th>Remarks</th>
</tr><% for timesheet in @timesheets%>
<tr> <td><%= date_select ''timesheet'',
''created_at'' %></td>
<%@projects=Project.find_all%></td>
<td><%= collection_select("timesheet",
"project" , @projects,
"name", "name") %></td>
<td><%= text_field ''timesheet'',
''hours_worked'', "size" => 31
%></td><td >
<%= text_area ''timesheet'',
''remarks'' ,"cols" => 22, "rows"
=> 5 %></td>
</tr>
<%end%>
</table>
<%= submit_tag "Edit" %>
<%= end_form_tag %>
Thanks in Advance,
Harish
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---