app/views/spree/admin/promotions/_form.html.erb in spree_promo-1.1.6 vs app/views/spree/admin/promotions/_form.html.erb in spree_promo-1.2.0.rc1
- old
+ new
@@ -1,18 +1,5 @@
-<% if @promotion && (@promotion.errors.any? || @promotion.rules.any? { |r| r.errors.any? }) %>
- <% error_group = [@promotion.errors, @promotion.rules.map(&:errors)].flatten %>
- <div id="errorExplanation" class="errorExplanation" data-hook>
- <h2><%= t(:errors_prohibited_this_record_from_being_saved, :count => error_group.count) %>:</h2>
- <p><%= t(:there_were_problems_with_the_following_fields) %>:</p>
- <ul>
- <% error_group.each do |errors| %>
- <% errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- <% end %>
- </ul>
- </div>
-<% end %>
+<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @promotion } %>
<fieldset id="general_fields">
<legend><%= t(:general) %></legend>
<%= f.field_container :name do %>
<%= f.label :name %><br />
<%= f.text_field :name %>