make own dummy, less confusing what is gem/engine and what is app
This commit is contained in:
3
dummy/app/assets/config/manifest.js
Normal file
3
dummy/app/assets/config/manifest.js
Normal file
@ -0,0 +1,3 @@
|
||||
//= link_tree ../images
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link_directory ../javascript .js
|
0
dummy/app/assets/images/.keep
Normal file
0
dummy/app/assets/images/.keep
Normal file
3
dummy/app/assets/javascript/application.js
Normal file
3
dummy/app/assets/javascript/application.js
Normal file
@ -0,0 +1,3 @@
|
||||
//= require opal_main
|
||||
|
||||
Opal.require('opal_main');
|
1
dummy/app/assets/javascript/opal_main.js.rb
Normal file
1
dummy/app/assets/javascript/opal_main.js.rb
Normal file
@ -0,0 +1 @@
|
||||
require "vue_r"
|
15
dummy/app/assets/stylesheets/application.css
Normal file
15
dummy/app/assets/stylesheets/application.css
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
||||
* listed below.
|
||||
*
|
||||
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
|
||||
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
||||
*
|
||||
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
||||
* compiled file so the styles you add here take precedence over styles defined in any other CSS
|
||||
* files in this directory. Styles in this file should be added after the last require_* statement.
|
||||
* It is generally better to create a new file per style scope.
|
||||
*
|
||||
*= require_tree .
|
||||
*= require_self
|
||||
*/
|
4
dummy/app/channels/application_cable/channel.rb
Normal file
4
dummy/app/channels/application_cable/channel.rb
Normal file
@ -0,0 +1,4 @@
|
||||
module ApplicationCable
|
||||
class Channel < ActionCable::Channel::Base
|
||||
end
|
||||
end
|
4
dummy/app/channels/application_cable/connection.rb
Normal file
4
dummy/app/channels/application_cable/connection.rb
Normal file
@ -0,0 +1,4 @@
|
||||
module ApplicationCable
|
||||
class Connection < ActionCable::Connection::Base
|
||||
end
|
||||
end
|
2
dummy/app/controllers/application_controller.rb
Normal file
2
dummy/app/controllers/application_controller.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
end
|
0
dummy/app/controllers/concerns/.keep
Normal file
0
dummy/app/controllers/concerns/.keep
Normal file
58
dummy/app/controllers/images_controller.rb
Normal file
58
dummy/app/controllers/images_controller.rb
Normal file
@ -0,0 +1,58 @@
|
||||
class ImagesController < ApplicationController
|
||||
before_action :set_image, only: %i[ show edit update destroy ]
|
||||
|
||||
# GET /images
|
||||
def index
|
||||
@images = Image.all
|
||||
end
|
||||
|
||||
# GET /images/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /images/new
|
||||
def new
|
||||
@image = Image.new
|
||||
end
|
||||
|
||||
# GET /images/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /images
|
||||
def create
|
||||
@image = Image.new(image_params)
|
||||
|
||||
if @image.save
|
||||
redirect_to @image, notice: "Image was successfully created."
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /images/1
|
||||
def update
|
||||
if @image.update(image_params)
|
||||
redirect_to @image, notice: "Image was successfully updated."
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /images/1
|
||||
def destroy
|
||||
@image.destroy
|
||||
redirect_to images_url, notice: "Image was successfully destroyed."
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_image
|
||||
@image = Image.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def image_params
|
||||
params.fetch(:image, {})
|
||||
end
|
||||
end
|
2
dummy/app/helpers/application_helper.rb
Normal file
2
dummy/app/helpers/application_helper.rb
Normal file
@ -0,0 +1,2 @@
|
||||
module ApplicationHelper
|
||||
end
|
3
dummy/app/javascript/application.js
Normal file
3
dummy/app/javascript/application.js
Normal file
@ -0,0 +1,3 @@
|
||||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
|
||||
import "@hotwired/turbo-rails"
|
||||
import "controllers"
|
9
dummy/app/javascript/controllers/application.js
Normal file
9
dummy/app/javascript/controllers/application.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { Application } from "@hotwired/stimulus"
|
||||
|
||||
const application = Application.start()
|
||||
|
||||
// Configure Stimulus development experience
|
||||
application.debug = false
|
||||
window.Stimulus = application
|
||||
|
||||
export { application }
|
7
dummy/app/javascript/controllers/hello_controller.js
Normal file
7
dummy/app/javascript/controllers/hello_controller.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.textContent = "Hello World!"
|
||||
}
|
||||
}
|
11
dummy/app/javascript/controllers/index.js
Normal file
11
dummy/app/javascript/controllers/index.js
Normal file
@ -0,0 +1,11 @@
|
||||
// Import and register all your controllers from the importmap under controllers/*
|
||||
|
||||
import { application } from "controllers/application"
|
||||
|
||||
// Eager load all controllers defined in the import map under controllers/**/*_controller
|
||||
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
|
||||
eagerLoadControllersFrom("controllers", application)
|
||||
|
||||
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
|
||||
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
|
||||
// lazyLoadControllersFrom("controllers", application)
|
7
dummy/app/jobs/application_job.rb
Normal file
7
dummy/app/jobs/application_job.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
# Automatically retry jobs that encountered a deadlock
|
||||
# retry_on ActiveRecord::Deadlocked
|
||||
|
||||
# Most jobs are safe to ignore if the underlying records are no longer available
|
||||
# discard_on ActiveJob::DeserializationError
|
||||
end
|
4
dummy/app/mailers/application_mailer.rb
Normal file
4
dummy/app/mailers/application_mailer.rb
Normal file
@ -0,0 +1,4 @@
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: "from@example.com"
|
||||
layout "mailer"
|
||||
end
|
3
dummy/app/models/application_record.rb
Normal file
3
dummy/app/models/application_record.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
primary_abstract_class
|
||||
end
|
0
dummy/app/models/concerns/.keep
Normal file
0
dummy/app/models/concerns/.keep
Normal file
2
dummy/app/models/image.rb
Normal file
2
dummy/app/models/image.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class Image < ActiveYaml::Base
|
||||
end
|
19
dummy/app/views/images/index.html.haml
Normal file
19
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
|
23
dummy/app/views/images/show.html.haml
Normal file
23
dummy/app/views/images/show.html.haml
Normal file
@ -0,0 +1,23 @@
|
||||
#app
|
||||
.flex.justify-center
|
||||
= #@image.attributes
|
||||
|
||||
.flex.justify-center
|
||||
%a.underline{ e_click: "bg_change" , r_class: 'back'}
|
||||
{{ back }}
|
||||
:opal
|
||||
puts "here1"
|
||||
class Clicker < VueR::Application
|
||||
def bg_change
|
||||
self.state = !self.state
|
||||
end
|
||||
def back
|
||||
self.state ? "bg-cyan-50" : "bg-cyan-200"
|
||||
end
|
||||
end
|
||||
|
||||
puts "here2"
|
||||
click = Clicker.new(bg: 'bg-cyan-200' , state: true)
|
||||
click.mount("#app")
|
||||
|
||||
puts "here3"
|
16
dummy/app/views/layouts/application.html.erb
Normal file
16
dummy/app/views/layouts/application.html.erb
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dummy</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= stylesheet_link_tag "application" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
13
dummy/app/views/layouts/mailer.html.erb
Normal file
13
dummy/app/views/layouts/mailer.html.erb
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
1
dummy/app/views/layouts/mailer.text.erb
Normal file
1
dummy/app/views/layouts/mailer.text.erb
Normal file
@ -0,0 +1 @@
|
||||
<%= yield %>
|
Reference in New Issue
Block a user