fixed, opal helper was not loaded, why is wip

This commit is contained in:
Torsten 2023-02-08 15:38:00 +02:00
parent 6d48e0cdd4
commit 8717ac7593
10 changed files with 36 additions and 12 deletions

View File

@ -10,6 +10,7 @@ gem "puma" , "5.6.5"
gem "haml-rails"
gem "sqlite3"
gem "active_hash"
gem "opal-rails"
# Start debugger with binding.b [https://github.com/ruby/debug]
# gem "debug", ">= 1.0.0"

View File

@ -194,6 +194,7 @@ PLATFORMS
DEPENDENCIES
active_hash
haml-rails
opal-rails
puma (= 5.6.5)
rails
sprockets-rails

View File

@ -1 +0,0 @@
//= link_tree ../javascript .js

View File

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

View File

@ -6,10 +6,6 @@ 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

@ -1,8 +1,17 @@
require "opal"
require "native"
require 'promise'
require 'opal-parser'
require 'browser/setup/mini'
require "vue_r/application"
require "vue_r/mounter"
puts "hello world!"
# Uncomment the following to print out you're hello-world with Opal:
#
# puts "hello world!"
#
# The following will append a hello-world to your <body> element:
#

View File

@ -1,2 +1,3 @@
class ApplicationController < ActionController::Base
helper OpalHelper
end

View File

@ -6,9 +6,6 @@
%a.underline{ e_click: "bg_change" , r_class: 'back'}
{{ back }}
:opal
puts "HI"
:plain
class Clicker < VueR::Application
def bg_change
self.state = !self.state

View File

@ -7,8 +7,7 @@
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "vue_r" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "dummy" %>
</head>
<body>

View File

@ -0,0 +1,22 @@
# Check out the full list of the available configuration options at
# https://github.com/opal/opal/blob/master/lib/opal/config.rb
Rails.application.configure do
# We suggest keeping the configuration above as default for all environments,
# disabling some of them might slightly reduce the bundle size or reduce performance
# by degrading some ruby features.
config.opal.method_missing_enabled = true
config.opal.const_missing_enabled = true
config.opal.arity_check_enabled = true
config.opal.freezing_stubs_enabled = true
config.opal.dynamic_require_severity = :ignore
# To enable passing assigns from the controller to the opal template handler
# change the following configuration to one of these values:
#
# - true # both locals and instance variables
# - :locals # only locals
# - :ivars # only instance variables
#
config.opal.assigns_in_templates = false
end