Skip to content

Commit e37f87d

Browse files
committed
setup turbolinks dummy app for testing
1 parent 59197f2 commit e37f87d

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

spec/dummy/app/assets/javascripts/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//= require rails-ujs
1414
//= require activestorage
1515
//= require matestack-ui-core
16-
//= require_tree .
16+
//= require cable
1717

1818
//= require demo/component
1919

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require rails-ujs
14+
//= require activestorage
15+
//= require turbolinks
16+
//= require matestack-ui-core
17+
//= require cable
18+
19+
//= require demo/component
20+
21+
App.cable.subscriptions.create("MatestackUiCoreChannel", {
22+
received(data) {
23+
MatestackUiCore.matestackEventHub.$emit('MatestackUiCoreChannel', data)
24+
}
25+
});

spec/dummy/app/views/layouts/application_with_turbolinks.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<%= csp_meta_tag %>
77

88
<%= stylesheet_link_tag 'application', media: 'all' %>
9-
<%= javascript_include_tag 'application' %>
9+
<%= javascript_include_tag 'application_with_turbolinks' %>
1010
</head>
1111

1212
<body>

spec/dummy/config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# Precompile additional assets.
1313
# application.js, application.css, and all non-JS/CSS in the app/assets
1414
# folder are already added.
15-
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
15+
Rails.application.config.assets.precompile += %w( application_with_turbolinks.js )

0 commit comments

Comments
 (0)