<%= simple_form_for @complementary_exam_setting, html: { class: "smart-form" } do |f| %> <% if f.object.errors[:base].present? %>
<%= f.object.errors[:base].first %>
<% end %>
<%= f.input :description %>
<%= f.input :initials %>
<%= f.input :calculation_type, as: :select2, elements: CalculationTypes.to_select.to_json %>
<%= f.input :affected_score, as: :select2, elements: AffectedScoreTypes.to_select.to_json %>
<%= f.input :maximum_score %>
<%= f.input :number_of_decimal_places %>
<%= f.input :grade_ids, as: :select2, elements: grades_to_select2(grades), multiple: true, input_html: { value: f.object.grade_ids.join(','), data: { without_json_parser: true } } %>
<%= f.input :year, as: :integer, readonly: action_name != 'new' %>
<% end %>
<% content_for :js do %> <%= javascript_include_tag 'views/complementary_exam_settings/form' %> <% end %>