<%= simple_nested_form_for([:settings,@promotion]) do |f| %> <%= f.error_notification %>
vpn_key
date_range <% if !@promotion.promo_start_date.nil?%> <% else %> <% end %>
date_range <% if !@promotion.promo_end_date.nil?%> <% else %> <% end %>
access_time <% if !@promotion.promo_start_hour.nil?%> <% else %> <% end %>
access_time <% if !@promotion.promo_end_hour.nil?%> <% else %> <% end %>

<%= f.hidden_field :promo_day, :class => "form-control" %>

<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> <% arr.push(p) %> <% end %>
<% sample = [] %> <% if !@promotion.original_product.nil? %> <% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %> <% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%> <% else %> <% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%> <% end %> <% end %>
<%= f.input :original_product,collection: sample %>
<%= f.input :min_qty %>

Item Code
Min Qty
Net off
Net Price
Percentage
<%= f.fields_for :promotion_products do |pro| %>
<%= pro.hidden_field :item_code,:class => "promo_product" %> <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> <% arr.push(p) %> <% end %>
<%= pro.input :item_code, :class => 'promoproduct', collection:[],input_html: { selected: 2 }, label: false %>
<%= pro.input :min_qty , label: false%>
<%= pro.input :net_off , label: false %>
<%= pro.input :net_price , label: false %>
<%= pro.input :percentage , label: false %>
<%= pro.link_to_remove "X" %>
<% end %>
<%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary addProduct' %>

<%= f.button :submit %>
<% end %>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse