test_apps/app/application_controller.rb in opal-rails-2.0.2 vs test_apps/app/application_controller.rb in opal-rails-2.0.3
- old
+ new
@@ -10,10 +10,15 @@
<script type="text/ruby">
puts 'hello from a script tag!'
</script>
HTML
+HAML = <<~HAML
+:opal
+ $haml_filter = :working
+HAML
+
WITH_ASSIGNMENTS = File.read "#{__dir__}/assets/javascripts/with_assignments.js.rb"
require_relative '../../app/helpers/opal_helper'
class ApplicationController < ActionController::Base
@@ -21,10 +26,11 @@
helper OpalHelper
layout 'application'
self.view_paths = [ActionView::FixtureResolver.new(
'layouts/application.html.erb' => LAYOUT,
'application/index.html.erb' => INDEX,
+ 'application/haml_filter.html.haml' => HAML,
'application/with_assignments.js.opal' => WITH_ASSIGNMENTS,
)]
def index
end
@@ -40,9 +46,12 @@
@array_var = [1,'a']
@hash_var = {a: 1, b: 2}
@object_var = object
render type: :js, locals: { local_var: 'i am local' }
+ end
+
+ def haml_filter
end
end
Rails.logger = Logger.new(STDOUT) if $DEBUG