<%= link_to_function(""+ employee.login, "show_hide(#{employee.id.to_s})") %> <% for material in employee.materials do %> <%= hidden_field_tag "report[done_materials_attributes][#{material.asset_id}_#{employee.id}][material_id]", material.asset_id %> <%= hidden_field_tag "report[done_materials_attributes][#{material.asset_id}_#{employee.id}][employee_id]", employee.id %> <%= hidden_field_tag "report[done_materials_attributes][#{material.asset_id}_#{employee.id}][material_name]", material_name(material) %> <%= material_name(material) %> <%= text_field_tag "report[done_materials_attributes][#{material.asset_id}_#{employee.id}][count]", nil, :size => 1, :class => 'number', :max => material.count, :onchange => "getSum()" %>
На руках: <%= material.count%>
<%= button_to_function '+', "setCount('report_done_materials_attributes_#{material.asset_id}_#{employee.id}_count', '1', 'plus')" %> <%= button_to_function '-', "setCount('report_done_materials_attributes_#{material.asset_id}_#{employee.id}_count', '1', 'minus')" %> <% end %>