Initial app
This commit is contained in:
8
app/views/puzzles/index.html.slim
Normal file
8
app/views/puzzles/index.html.slim
Normal file
@@ -0,0 +1,8 @@
|
||||
h1 Puzzles
|
||||
|
||||
= link_to "New puzzle", new_puzzle_path
|
||||
|
||||
div
|
||||
- @puzzles.each do |puzzle|
|
||||
div
|
||||
= link_to puzzle.name, puzzle
|
11
app/views/puzzles/new.html.slim
Normal file
11
app/views/puzzles/new.html.slim
Normal file
@@ -0,0 +1,11 @@
|
||||
h1 New puzzle
|
||||
|
||||
= form_with model: @puzzle do |form|
|
||||
div
|
||||
= form.label :name
|
||||
= form.text_field :name
|
||||
div
|
||||
= form.label :image, style: "display: block"
|
||||
= form.file_field :image, accept: "image/*"
|
||||
div
|
||||
= form.submit
|
7
app/views/puzzles/show.html.slim
Normal file
7
app/views/puzzles/show.html.slim
Normal file
@@ -0,0 +1,7 @@
|
||||
h1 = @puzzle.name
|
||||
|
||||
= link_to "Back", puzzles_path
|
||||
|
||||
= image_tag @puzzle.image if @puzzle.image.attached?
|
||||
|
||||
= button_to "Delete", @puzzle, method: :delete, data: { turbo_confirm: "Are you suuure??" }
|
Reference in New Issue
Block a user