an opal experiment

This commit is contained in:
Torsten
2023-02-05 16:18:18 +02:00
parent 549ccfad5d
commit 50874df46f
14 changed files with 127 additions and 1 deletions

View 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'

View File

@ -0,0 +1,7 @@
%h1 Editing kantum
= render 'form'
= link_to 'Show', @kantum
\|
= link_to 'Back', kanta_path

View 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

View File

@ -0,0 +1,5 @@
%h1 New kantum
= render 'form'
= link_to 'Back', kanta_path

View 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')

View File

@ -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"}