move code from app here
This commit is contained in:
10
test/dummy/app/views/images/_form.html.haml
Normal file
10
test/dummy/app/views/images/_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
test/dummy/app/views/images/edit.html.haml
Normal file
7
test/dummy/app/views/images/edit.html.haml
Normal file
@ -0,0 +1,7 @@
|
||||
%h1 Editing kantum
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @kantum
|
||||
\|
|
||||
= link_to 'Back', kanta_path
|
19
test/dummy/app/views/images/index.html.haml
Normal file
19
test/dummy/app/views/images/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
test/dummy/app/views/images/new.html.haml
Normal file
5
test/dummy/app/views/images/new.html.haml
Normal file
@ -0,0 +1,5 @@
|
||||
%h1 New kantum
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', kanta_path
|
19
test/dummy/app/views/images/show.html.haml
Normal file
19
test/dummy/app/views/images/show.html.haml
Normal 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")
|
Reference in New Issue
Block a user