form_for output remote true html class form-horizontal role form do di

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%= form_for(@output, remote: true, html: { class: "form-horizontal", role: "form" }) do |f| %>
<div id="error_explanation" class="bg-danger text-danger">
</div>
<%= f.hidden_field :date, :value => @date %>
<div class="form-group">
<%= f.label :employee, "Сотрудник", class: "col-sm-2 control-label" %>
<div class="col-sm-10">
<%= f.collection_select :employee_id, Employee.all, :id, :fio, {:promt => true}, {class: "form-control"} %>
</div>
</div>
<%= f.fields_for :output_products do |ff| %>
<%= render 'output_product_fields', :f => ff %>
<% end %>
<div class="links">
<%= link_to_add_association image_tag('plus.svg', size: "24x24", alt: "Добавить"), f, :output_products %>
</div>
<%= f.submit class: "btn btn-primary" %>
<%= link_to "Cancel", "#", class: "btn", data: {dismiss: "modal"} %>
<% end %>