Skip to content

Commit

Permalink
fixed deprecated views that depended on attribute_fu
Browse files Browse the repository at this point in the history
  • Loading branch information
drefined authored and romul committed Nov 11, 2010
1 parent 889d995 commit d7cd09f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
7 changes: 5 additions & 2 deletions app/views/admin/variants/_edit_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
</tr>
</thead>
<tbody id="volume_prices">
<%= f.render_associated_form(@variant.volume_prices) %>
<%= f.fields_for :volume_prices do |vp_form| %>
<%= render 'volume_price_fields', :f => vp_form %>
<% end %>
</tbody>
</table>
<%= f.add_associated_link(icon('add') + ' ' + t("add_volume_price"), @variant.volume_prices.build) %>
<%= link_to_add_fields icon('add') + ' ' + t("add_volume_price"), "tbody#volume_prices", f, :volume_prices %>
<br/><br/>

19 changes: 0 additions & 19 deletions app/views/admin/variants/_volume_price.html.erb

This file was deleted.

21 changes: 21 additions & 0 deletions app/views/admin/variants/_volume_price_fields.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<tr class="volume_price fields">
<td>
<%= error_message_on(f.object, :display) %>
<%= f.text_field :display, :size => 10 %>
</td>
<td>
<%= error_message_on(f.object, :range) %>
<%= f.text_field :range, :size => 10 %>
</td>
<td>
<%= error_message_on(f.object, :amount) %>
<%= f.text_field :amount, :size => 10 %>
</td>
<td>
<%= error_message_on(f.object, :position) %>
<%= f.text_field :position, :size => 3 %>
</td>
<td valign="actions">
<%= link_to_remove_fields t("remove"), f %>
</td>
</tr>
13 changes: 7 additions & 6 deletions app/views/admin/variants/volume_prices.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<%= render :partial => 'admin/shared/product_tabs', :locals => {:current => "Volume Pricing"} %>
<%= error_messages_for :variant %>
<% form_for(:variant, :url => admin_product_variant_url(@product, @variant), :html => { :method => :put }) do |f| %>
<%= render "shared/error_messages", :target => @variant %>
<%= form_for(@variant, :url => admin_product_variant_url(@product, @variant), :html => { :method => :put }) do |f| %>
<h3><%= t("volume_prices") %></h3>
<table class="index">
<thead>
Expand All @@ -18,11 +17,13 @@
</tr>
</thead>
<tbody id="volume_prices">
<%= f.render_associated_form(@variant.volume_prices) %>
<%= f.fields_for :volume_prices do |vp_form| %>
<%= render 'volume_price_fields', :f => vp_form %>
<% end %>
</tbody>
</table>
<%= f.add_associated_link(icon('add') + ' ' + t("add_volume_price"), @variant.volume_prices.build) %>
<%= link_to_add_fields icon('add') + ' ' + t("add_volume_price"), "tbody#volume_prices", f, :volume_prices %>
<br/><br/>

<%= render :partial => 'admin/shared/edit_resource_links' %>
<% end %>
<% end %>

0 comments on commit d7cd09f

Please sign in to comment.