<%= simple_nested_form_for([:settings,@promotion]) do |f| %> <%= f.error_notification %>
<%= f.input :promo_code %>
Promo Start Date <%= f.date_field :promo_start_date, :placeholder => "From Date" , :class => "form-control"%>
Promo End Date <%= f.date_field :promo_end_date ,:placeholder => "To Date" , :class => "form-control"%>
<%= f.input :promo_start_hour %>
<%= f.input :promo_end_hour %>
<%= f.input :promo_day %>
<%= f.input :promo_type,input_html: { class: "" }, collection: %w{Quantity Net_off Net_price Percentage},:class => 'form-control' ,:label => "Promotion Type" %>
<%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %>
<%= f.input :min_qty %>

<%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %>


<%= f.fields_for :promotion_products do |p| %>
<%= p.input :item_code , :class => "form-control" %>
<%= p.input :min_qty , :class => "form-control" %>
<%= p.input :net_off , :class => "form-control" %>
<%= p.input :net_price , :class => "form-control" %>
<%= p.input :percentage , :class => "form-control" %>
<%= p.link_to_remove "X"%>
<% end %>
<%= f.button :submit %>
<% end %>