blob: 9cbcec7f88e7488bfe1271d4cedf3143c8fb2649 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<%= form_with url: form_url, method: form_method, local: true do |f| %>
<% ScoringCriterium.grouped_by_category.each do |category, criteria| %>
<fieldset>
<legend><%= category.titlecase %></legend>
<% criteria.each do |criterium| %>
<% current_score = existing_scores.find { |score| score.scoring_criterium_id == criterium.id } %>
<p>
<%= select_tag "scores[#{criterium.id}][value]",
options_for_select(1..5, current_score&.value),
required: true,
prompt: "Score" %>
<%= label_tag "scores[#{criterium.id}][value]",
criterium.name.capitalize %>
</p>
<% end %>
</fieldset>
<% end %>
<%= f.submit submit_text %>
<% end %>
|