make own dummy, less confusing what is gem/engine and what is app

This commit is contained in:
2023-02-08 17:18:57 +02:00
parent ad237c3afb
commit 951ced7734
84 changed files with 255 additions and 90 deletions

View File

@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_directory ../javascript .js

View File

View File

@ -0,0 +1,3 @@
//= require opal_main
Opal.require('opal_main');

View File

@ -0,0 +1 @@
require "vue_r"

View 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
*/

View File

@ -0,0 +1,4 @@
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end

View File

@ -0,0 +1,4 @@
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end

View File

@ -0,0 +1,2 @@
class ApplicationController < ActionController::Base
end

View File

View 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

View File

@ -0,0 +1,2 @@
module ApplicationHelper
end

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

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

View File

@ -0,0 +1,7 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
connect() {
this.element.textContent = "Hello World!"
}
}

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

View 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

View File

@ -0,0 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end

View File

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end

View File

View File

@ -0,0 +1,2 @@
class Image < ActiveYaml::Base
end

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,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"

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

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

View File

@ -0,0 +1 @@
<%= yield %>