still trying to get the code working inside an engine (was fine in app)

This commit is contained in:
Torsten 2023-02-08 12:29:52 +02:00
parent b956f5709a
commit 53b549e921
10 changed files with 18 additions and 6 deletions

View File

@ -1 +1 @@
//= link_directory ../javascript .js
//= link_tree ../../javascript .js

View File

@ -1,2 +1,2 @@
//= link_directory ../stylesheets/vue_r .css
//= link_directory ../../javascript .js
//= link_tree ../javascript .js

View File

@ -0,0 +1,8 @@
require "opal"
require "native"
require 'promise'
require 'browser/setup/mini'
require 'opal-parser'
require "vue_r/application"
require "vue_r/mounter"

View File

@ -1,5 +1,3 @@
require 'opal-parser'
module VueR
class Mounter
HANDLEBARS = /{{\s?([^}]*)\s?}}/

View File

@ -1,2 +0,0 @@
require "vue_r/application"
require "vue_r/mounter"

View File

@ -1,7 +1,13 @@
require "opal-rails"
require "opal-browser"
module VueR
class Engine < ::Rails::Engine
isolate_namespace VueR
initializer "vue_r.assets.precompile" do |app|
app.config.assets.precompile += %w( vue_r.js )
end
end
end

View File

@ -7,6 +7,7 @@
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "vue_r.js" %>
</head>
<body>

View File

@ -1,6 +1,7 @@
require_relative "boot"
require "rails/all"
require "vue_r/engine"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.