Improve forms
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-15 09:26:03 +01:00
parent caa45332b0
commit 64109cdfd3
4 changed files with 21 additions and 15 deletions

View File

@ -12,7 +12,7 @@ class ContestsController < ApplicationController
def new
@contest = Contest.new
@title = "Create a new jigsaw puzzle competition"
@title = "New jigsaw puzzle competition"
end
def create

View File

@ -1,8 +1,8 @@
= form_with model: contest do |form|
.row
.col.g-3
.form-floating.mt-5
.col
.form-floating
= form.text_field :name, autocomplete: "off", class: "form-control"
= form.label :name, class: "required"
div.mt-3
= form.submit
= form.submit "Create", class: "btn btn-primary"

View File

@ -4,13 +4,13 @@ html
body
.container.mt-5
.float-end.ms-3
= button_to "Log out", session_path, method: :delete
.float-end.mt-1.ms-3
= button_to "Log out", session_path, method: :delete
.float-end.mt-2.ms-3
= link_to "Settings", user_path(@current_user)
.float-end.mt-1
.float-end.mt-2
= link_to "Home", contests_path
h1 = @title
h1.mb-4 = @title
= yield

View File

@ -1,9 +1,15 @@
= form_with model: user do |form|
.row.mb-3
.col
.input-group
.input-group-text @
.form-floating
= form.text_field :username, autocomplete: "off", class: "form-control"
= form.label :username, class: "required"
.row.mb-3
.col
.form-floating
= form.text_field :email_address, autocomplete: "off", class: "form-control", type: "email"
= form.label :email_address, class: "required"
div
= form.label :username
= form.text_field :username
div
= form.label :email_address
= form.text_field :email_address
div
= form.submit
= form.submit "Save", class: "btn btn-primary"