Organise with layouts
This commit is contained in:
8
app/views/contests/_form.html.slim
Normal file
8
app/views/contests/_form.html.slim
Normal file
@@ -0,0 +1,8 @@
|
||||
= form_with model: contest do |form|
|
||||
.row
|
||||
.col.g-3
|
||||
.form-floating.mt-5
|
||||
= form.text_field :name, autocomplete: "off", class: "form-control"
|
||||
= form.label :name, class: "required"
|
||||
div.mt-3
|
||||
= form.submit
|
@@ -1,14 +1,3 @@
|
||||
- if authenticated?
|
||||
.float-end.ms-3
|
||||
= button_to "Log out", session_path, method: :delete
|
||||
.float-end.mt-1
|
||||
= link_to "Settings", user_path(@user)
|
||||
|
||||
h1 Welcome!
|
||||
|
||||
.alert.alert-primary role="alert"
|
||||
| This is a brand new website!
|
||||
|
||||
h4.mt-4 Manage your contests
|
||||
|
||||
- @contests.each do |contest|
|
||||
|
@@ -1,8 +1 @@
|
||||
h1 Create a new contest
|
||||
|
||||
= form_with model: @contest do |form|
|
||||
div
|
||||
= form.label :name
|
||||
= form.text_field :name
|
||||
div
|
||||
= form.submit
|
||||
= render "form", contest: @contest
|
@@ -1,4 +0,0 @@
|
||||
h1 Contest: "#{@contest.name}"
|
||||
|
||||
a.btn.btn-primary href=root_path
|
||||
| Back to all contests
|
Reference in New Issue
Block a user