Improve forms
This commit is contained in:
parent
caa45332b0
commit
64109cdfd3
@ -12,7 +12,7 @@ class ContestsController < ApplicationController
|
|||||||
|
|
||||||
def new
|
def new
|
||||||
@contest = Contest.new
|
@contest = Contest.new
|
||||||
@title = "Create a new jigsaw puzzle competition"
|
@title = "New jigsaw puzzle competition"
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
= form_with model: contest do |form|
|
= form_with model: contest do |form|
|
||||||
.row
|
.row
|
||||||
.col.g-3
|
.col
|
||||||
.form-floating.mt-5
|
.form-floating
|
||||||
= form.text_field :name, autocomplete: "off", class: "form-control"
|
= form.text_field :name, autocomplete: "off", class: "form-control"
|
||||||
= form.label :name, class: "required"
|
= form.label :name, class: "required"
|
||||||
div.mt-3
|
div.mt-3
|
||||||
= form.submit
|
= form.submit "Create", class: "btn btn-primary"
|
@ -4,13 +4,13 @@ html
|
|||||||
|
|
||||||
body
|
body
|
||||||
.container.mt-5
|
.container.mt-5
|
||||||
.float-end.ms-3
|
|
||||||
= button_to "Log out", session_path, method: :delete
|
|
||||||
.float-end.mt-1.ms-3
|
.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)
|
= link_to "Settings", user_path(@current_user)
|
||||||
.float-end.mt-1
|
.float-end.mt-2
|
||||||
= link_to "Home", contests_path
|
= link_to "Home", contests_path
|
||||||
|
|
||||||
h1 = @title
|
h1.mb-4 = @title
|
||||||
|
|
||||||
= yield
|
= yield
|
@ -1,9 +1,15 @@
|
|||||||
= form_with model: user do |form|
|
= 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
|
div
|
||||||
= form.label :username
|
= form.submit "Save", class: "btn btn-primary"
|
||||||
= form.text_field :username
|
|
||||||
div
|
|
||||||
= form.label :email_address
|
|
||||||
= form.text_field :email_address
|
|
||||||
div
|
|
||||||
= form.submit
|
|
Loading…
x
Reference in New Issue
Block a user