move code from app here

This commit is contained in:
2023-02-08 11:39:50 +02:00
parent c9031f9dd2
commit 1181dd0bfd
8 changed files with 193 additions and 0 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,19 @@
#app
.flex.justify-center
= #@image.attributes
.flex.justify-center
%a.underline{ e_click: "bg_change" , r_class: 'back'}
{{ back }}
:opal
class Clicker < VueR::Application
def bg_change
self.state = !self.state
end
def back
self.state ? "bg-cyan-50" : "bg-cyan-200"
end
end
kanta = Clicker.new(bg: 'bg-cyan-200' , state: true)
kanta.mount("#app")