<% content_for :js do %> <%= javascript_include_tag 'views/custom_rounding_tables/form' %> <% end %> <%= simple_form_for @custom_rounding_table, html: { class: 'smart-form custom_rounding_tables' } do |f| %> <%= f.error_notification %>
<%= f.input :name, input_html: { maxlength: 255 } %>
<%= f.input :year, input_html: { maxlength: 4 } %>
<%= f.association :unities, as: :select2, elements: @unities, multiple: true, input_html: { value: f.object.unity_ids.join(','), data: { without_json_parser: true } } %>
<%= f.association :courses, as: :select2, elements: @courses, multiple: true, input_html: { value: f.object.course_ids.join(','), data: { without_json_parser: true } } %>
<%= f.association :grades, as: :select2, elements: @filtered_grades, multiple: true, input_html: { value: f.object.grade_ids.join(','), data: { without_json_parser: true } } %>
<%= f.input :rounded_avaliations, as: :select2, elements: @rounded_avaliations, multiple: true, input_html: { value: f.object.rounded_avaliations.join(','), data: { without_json_parser: true } } %>
<% if f.object.errors.messages[:invalid_actions].present? %>
<%= f.object.errors[:invalid_actions].first %>
<% end %> <%= CustomRoundingTableValue.model_name.human %> <%= f.simple_fields_for :custom_rounding_table_values, @custom_rounding_table_values do |item| %> <%= render 'custom_rounding_table_values_fields', f: item %> <% end %>
<%= CustomRoundingTableValue.human_attribute_name :label %> <%= CustomRoundingTableValue.human_attribute_name :action %> <%= CustomRoundingTableValue.human_attribute_name :exact_decimal_place %>
<% end %>