From 2f13b3c9fe21debec4bd9afe4601125f4fe29ce2 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Mon, 12 Feb 2018 10:34:29 -0500 Subject: Pull activetext.js into dummy app with webpacker --- test/dummy/app/assets/javascripts/application.js | 14 -------------- test/dummy/app/assets/javascripts/cable.js | 13 ------------- test/dummy/app/assets/javascripts/channels/.keep | 0 test/dummy/app/assets/javascripts/messages.js | 2 -- test/dummy/app/assets/stylesheets/application.css | 1 + test/dummy/app/javascript/packs/application.js | 1 + test/dummy/app/views/layouts/application.html.erb | 4 ++-- test/dummy/app/views/messages/show.html.erb | 2 +- 8 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 test/dummy/app/assets/javascripts/application.js delete mode 100644 test/dummy/app/assets/javascripts/cable.js delete mode 100644 test/dummy/app/assets/javascripts/channels/.keep delete mode 100644 test/dummy/app/assets/javascripts/messages.js create mode 100644 test/dummy/app/javascript/packs/application.js (limited to 'test/dummy/app') diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js deleted file mode 100644 index e914de7396..0000000000 --- a/test/dummy/app/assets/javascripts/application.js +++ /dev/null @@ -1,14 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. JavaScript code in this file should be added after the last require_* statement. -// -// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require activestorage -//= require_tree . diff --git a/test/dummy/app/assets/javascripts/cable.js b/test/dummy/app/assets/javascripts/cable.js deleted file mode 100644 index 739aa5f022..0000000000 --- a/test/dummy/app/assets/javascripts/cable.js +++ /dev/null @@ -1,13 +0,0 @@ -// Action Cable provides the framework to deal with WebSockets in Rails. -// You can generate new channels where WebSocket features live using the `rails generate channel` command. -// -//= require action_cable -//= require_self -//= require_tree ./channels - -(function() { - this.App || (this.App = {}); - - App.cable = ActionCable.createConsumer(); - -}).call(this); diff --git a/test/dummy/app/assets/javascripts/channels/.keep b/test/dummy/app/assets/javascripts/channels/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/dummy/app/assets/javascripts/messages.js b/test/dummy/app/assets/javascripts/messages.js deleted file mode 100644 index dee720facd..0000000000 --- a/test/dummy/app/assets/javascripts/messages.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css index 0ebd7fe829..e4b10eb997 100644 --- a/test/dummy/app/assets/stylesheets/application.css +++ b/test/dummy/app/assets/stylesheets/application.css @@ -10,6 +10,7 @@ * 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 trix/dist/trix.css *= require_tree . *= require_self */ diff --git a/test/dummy/app/javascript/packs/application.js b/test/dummy/app/javascript/packs/application.js new file mode 100644 index 0000000000..f12ff2fdc3 --- /dev/null +++ b/test/dummy/app/javascript/packs/application.js @@ -0,0 +1 @@ +import "activetext" diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb index a6eb0174b7..f221f512b7 100644 --- a/test/dummy/app/views/layouts/application.html.erb +++ b/test/dummy/app/views/layouts/application.html.erb @@ -4,8 +4,8 @@ Dummy <%= csrf_meta_tags %> - <%= stylesheet_link_tag 'application', media: 'all' %> - <%= javascript_include_tag 'application' %> + <%= stylesheet_link_tag 'application', media: 'all' %> + <%= javascript_pack_tag 'application' %> diff --git a/test/dummy/app/views/messages/show.html.erb b/test/dummy/app/views/messages/show.html.erb index 837b11ef1d..feec71cb93 100644 --- a/test/dummy/app/views/messages/show.html.erb +++ b/test/dummy/app/views/messages/show.html.erb @@ -7,7 +7,7 @@

Content: - <%= @message.content %> + <%= raw @message.content %>

<%= link_to 'Edit', edit_message_path(@message) %> | -- cgit v1.2.3