diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 34c6624..8716310 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1 +1 @@ -//= link_tree ../../javascript .js +//= link_tree ../javascript .js diff --git a/app/assets/config/vue_r_manifest.js b/app/assets/config/vue_r_manifest.js index 028cd4d..b94f187 100644 --- a/app/assets/config/vue_r_manifest.js +++ b/app/assets/config/vue_r_manifest.js @@ -1,2 +1,2 @@ //= link_directory ../stylesheets/vue_r .css -//= link_tree ../javascript .js +//= link_tree ../../../opal .js diff --git a/lib/vue_r/engine.rb b/lib/vue_r/engine.rb index febe24d..7104cf6 100644 --- a/lib/vue_r/engine.rb +++ b/lib/vue_r/engine.rb @@ -1,3 +1,4 @@ +require 'opal' require "opal-rails" require "opal-browser" @@ -11,3 +12,6 @@ module VueR end end + +Opal.append_path File.expand_path('../../../opal', __FILE__) +Opal.use_gem 'opal-browser' diff --git a/app/assets/javascript/vue_r.rb b/opal/vue_r.rb similarity index 100% rename from app/assets/javascript/vue_r.rb rename to opal/vue_r.rb diff --git a/app/assets/javascript/vue_r/application.rb b/opal/vue_r/application.rb similarity index 100% rename from app/assets/javascript/vue_r/application.rb rename to opal/vue_r/application.rb diff --git a/app/assets/javascript/vue_r/mounter.rb b/opal/vue_r/mounter.rb similarity index 100% rename from app/assets/javascript/vue_r/mounter.rb rename to opal/vue_r/mounter.rb diff --git a/test/dummy/app/assets/config/manifest.js b/test/dummy/app/assets/config/manifest.js index 8a2e4b7..27109c9 100644 --- a/test/dummy/app/assets/config/manifest.js +++ b/test/dummy/app/assets/config/manifest.js @@ -1,3 +1,3 @@ //= link_tree ../images //= link_directory ../stylesheets .css -//= link vue_r_manifest.js +//= link_directory ../javascript .js diff --git a/app/assets/javascript/application.js.rb b/test/dummy/app/assets/javascript/application.js.rb similarity index 100% rename from app/assets/javascript/application.js.rb rename to test/dummy/app/assets/javascript/application.js.rb diff --git a/test/dummy/app/views/images/_form.html.haml b/test/dummy/app/views/images/_form.html.haml deleted file mode 100644 index 99b17e7..0000000 --- a/test/dummy/app/views/images/_form.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -= form_for @kantum do |f| - - if @kantum.errors.any? - #error_explanation - %h2= "#{pluralize(@kantum.errors.count, "error")} prohibited this kantum from being saved:" - %ul - - @kantum.errors.full_messages.each do |message| - %li= message - - .actions - = f.submit 'Save' diff --git a/test/dummy/app/views/images/edit.html.haml b/test/dummy/app/views/images/edit.html.haml deleted file mode 100644 index d2becac..0000000 --- a/test/dummy/app/views/images/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing kantum - -= render 'form' - -= link_to 'Show', @kantum -\| -= link_to 'Back', kanta_path diff --git a/test/dummy/app/views/images/new.html.haml b/test/dummy/app/views/images/new.html.haml deleted file mode 100644 index 0524e57..0000000 --- a/test/dummy/app/views/images/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 New kantum - -= render 'form' - -= link_to 'Back', kanta_path diff --git a/test/dummy/app/views/images/show.html.haml b/test/dummy/app/views/images/show.html.haml index c127eb1..5dfe290 100644 --- a/test/dummy/app/views/images/show.html.haml +++ b/test/dummy/app/views/images/show.html.haml @@ -6,6 +6,9 @@ %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 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb index 325833e..be462a1 100644 --- a/test/dummy/app/views/layouts/application.html.erb +++ b/test/dummy/app/views/layouts/application.html.erb @@ -7,7 +7,8 @@ <%= csp_meta_tag %> <%= stylesheet_link_tag "application" %> - <%= javascript_include_tag "vue_r.js" %> + <%= javascript_include_tag "vue_r" %> + <%= javascript_include_tag "application" %>