an opal experiment
This commit is contained in:
10
app/views/kanta/_form.html.haml
Normal file
10
app/views/kanta/_form.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
= form_for @kantum do |f|
|
||||
- if @kantum.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@kantum.errors.count, "error")} prohibited this kantum from being saved:"
|
||||
%ul
|
||||
- @kantum.errors.full_messages.each do |message|
|
||||
%li= message
|
||||
|
||||
.actions
|
||||
= f.submit 'Save'
|
7
app/views/kanta/edit.html.haml
Normal file
7
app/views/kanta/edit.html.haml
Normal file
@ -0,0 +1,7 @@
|
||||
%h1 Editing kantum
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @kantum
|
||||
\|
|
||||
= link_to 'Back', kanta_path
|
19
app/views/kanta/index.html.haml
Normal file
19
app/views/kanta/index.html.haml
Normal file
@ -0,0 +1,19 @@
|
||||
%h1 Listing kanta
|
||||
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
|
||||
%tbody
|
||||
- @kanta.each do |kantum|
|
||||
%tr
|
||||
%td= link_to 'Show', kantum
|
||||
%td= link_to 'Edit', edit_kantum_path(kantum)
|
||||
%td= link_to 'Destroy', kantum, method: :delete, data: { confirm: 'Are you sure?' }
|
||||
|
||||
%br
|
||||
|
||||
= link_to 'New Kantum', new_kantum_path
|
5
app/views/kanta/new.html.haml
Normal file
5
app/views/kanta/new.html.haml
Normal file
@ -0,0 +1,5 @@
|
||||
%h1 New kantum
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', kanta_path
|
18
app/views/kanta/show.html.haml
Normal file
18
app/views/kanta/show.html.haml
Normal file
@ -0,0 +1,18 @@
|
||||
.flex.justify-center
|
||||
.flex.flex-col
|
||||
= @image.attributes
|
||||
|
||||
%a.underline{ '@click' => "hi"}
|
||||
Back
|
||||
|
||||
:opal
|
||||
class Kanta
|
||||
def initialize(hash)
|
||||
hash.each do |k,v|
|
||||
puts k
|
||||
puts v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
kanta = Kanta.new(bg: 'bg-cyan-200')
|
@ -27,7 +27,8 @@
|
||||
= csp_meta_tag
|
||||
= stylesheet_link_tag "tailwind"
|
||||
= stylesheet_link_tag "application"
|
||||
|
||||
= javascript_include_tag "opal_main"
|
||||
|
||||
= javascript_importmap_tags
|
||||
- if false
|
||||
%script{:src => "https://cdn.tailwindcss.com"}
|
||||
|
Reference in New Issue
Block a user