<%= form_tag spree.admin_promotion_promotion_actions_path(@promotion), :remote => true, :id => 'new_promotion_action_form' do %> <% options = options_for_select( Rails.application.config.spree.promotions.actions.map(&:name).map {|name| [ t("promotion_action_types.#{name.demodulize.underscore}.name"), name] } ) %>
<%= t(:promotion_actions) %>
<%= label_tag :action_type, t(:add_action_of_type)%> <%= select_tag 'action_type', options, :class => 'select2 fullwidth' %>
<%= button t(:add), 'icon-plus', :class => 'fullwidth' %>
<% end %> <%= form_for @promotion, :url => spree.admin_promotion_path(@promotion), :method => :put do |f| %>
<% if @promotion.actions.any? %> <%= render :partial => 'promotion_action', :collection => @promotion.actions %> <% else %>
<%= t(:no_actions_added) %>
<% end %>
<%= button t(:update), 'icon-refresh' %>
<% end %>