From be2a93525069de2dfa3c23b0c23e7a9f7ad4c03d Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 29 Dec 2024 15:14:43 +0100 Subject: First commit. --- app/views/scores/_form.html.erb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/views/scores/_form.html.erb (limited to 'app/views/scores/_form.html.erb') diff --git a/app/views/scores/_form.html.erb b/app/views/scores/_form.html.erb new file mode 100644 index 0000000..9cbcec7 --- /dev/null +++ b/app/views/scores/_form.html.erb @@ -0,0 +1,19 @@ +<%= form_with url: form_url, method: form_method, local: true do |f| %> + <% ScoringCriterium.grouped_by_category.each do |category, criteria| %> +
+ <%= category.titlecase %> + <% criteria.each do |criterium| %> + <% current_score = existing_scores.find { |score| score.scoring_criterium_id == criterium.id } %> +

+ <%= 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 %> +

+ <% end %> +
+ <% end %> + <%= f.submit submit_text %> +<% end %> -- cgit v1.2.3