Add contestants
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-20 09:19:39 +01:00
parent 658c50fd04
commit 44507bb85c
18 changed files with 145 additions and 25 deletions

View File

@@ -0,0 +1,17 @@
= form_with model: contestant, url: url, method: method do |form|
.row.mb-3
.col
.form-floating
= form.text_field :name, autocomplete: "off", class: "form-control"
= form.label :name, class: "required"
.row.mb-3
.col
.form-floating
= form.text_field :email, autocomplete: "off", class: "form-control"
= form.label :email
.form-text Optional. Fill this only if you intend to send emails through this app.
.row.mt-4
.col
- if method == :patch
= link_to "Delete", contest_contestant_path(contest, contestant), data: { turbo_method: :delete }, class: "btn btn-danger me-2"
= form.submit submit_text, class: "btn btn-primary"

View File

@@ -0,0 +1 @@
= render "form", contest: @contest, contestant: @contestant, submit_text: "Save", method: :patch, url: "/contests/#{@contest.id}/contestants/#{@contestant.id}"

View File

@@ -0,0 +1 @@
= render "form", contest: @contest, contestant: @contestant, submit_text: "Add", method: :post, url: "/contests/#{@contest.id}/contestants"