Using form partial for the new rate. #1916

This commit is contained in:
Eric Davis
2009-01-19 10:45:53 -08:00
parent c3250c882a
commit ae0be85f76
3 changed files with 5 additions and 28 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
<% form_tag('/todo') do |f| %>
<% form_for(@rate) do |f| %>
<table class="list">
<thead>
<th style="width:15%"><%= l(:label_date) %></th>
@@ -12,7 +12,7 @@
<%= text_field_tag "date_from", nil, :size => 10 %><%= calendar_for('date_from') %>
</td>
<td>
<%=
<%= # TODO: move to controller once a hook is in place for the Admin panel
projects = Project.find(:all, :conditions => { :status => Project::STATUS_ACTIVE}, :include => :parent)
select_tag("project",projects_options_for_select(projects))
%>
+2 -26
View File
@@ -1,27 +1,3 @@
<h1>New rate</h1>
<h1><%= l(:rate_label_new_rate) %></h1>
<% form_for(@rate) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :amount %><br />
<%= f.text_field :amount %>
</p>
<p>
<%= f.label :user_id %><br />
<%= f.text_field :user_id %>
</p>
<p>
<%= f.label :project_id %><br />
<%= f.text_field :project_id %>
</p>
<p>
<%= f.label :date_in_effect %><br />
<%= f.date_select :date_in_effect %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
<%= link_to 'Back', rates_path %>
<%= render :partial => 'rates/form' %>
+1
View File
@@ -1,5 +1,6 @@
<h1><%= l(:rate_label_new_rate) %></h1>
<% @rate = Rate.new(:user => @user ) %>
<%= render :partial => 'rates/form' %>
<h1><%= l(:rate_label_rate_history) %></h1>