<% order.order_items.each do |order_item| %> <%= @order_form.fields_for :order_items, order_item do |oi| %> <% end %> <% end %> <% order.order_serves.each do |order_serve| %> <%= @order_form.fields_for :order_serves, order_serve do |os| %> <% end %> <% end %> <% order.order_promotes.each do |order_promote| %> <%= @order_form.fields_for :order_promotes, order_promote do |op| %> <% end %> <% end %>
<%= form_with model: order, url: admin_orders_path, multipart: true, local: true, id: 'new_order' do |f| %> <% @order_form = f %> <%= f.hidden_field :user_id %> <%= f.hidden_field :amount %> <% end %> Name
<%= order_item.good&.name %> <%= oi.hidden_field :cart_item_id, form: 'new_order' %> <%= oi.date_field :deliver_on, form: 'new_order' %> <%= oi.number_field :advance_price, form: 'new_order' %> <%= oi.text_field :comment, form: 'new_order' %> <%= order_item.amount %>
<%= order_serve.serve&.name %> <%= os.hidden_field :serve_id, form: 'new_order' %> <%= os.hidden_field :serve_charge_id, form: 'new_order' %> <%= os.number_field :amount, step: '0.01', form: 'new_order' %>
<%= order_promote.promote&.name %> <%= op.hidden_field :promote_id, form: 'new_order' %> <%= op.hidden_field :promote_charge_id, form: 'new_order' %> <%= op.number_field :amount, step: '0.01', form: 'new_order' %>