Capture the Chartkick JS and yield it in the layout

So that we can include all the JS at the bottom of
the page without error
This commit is contained in:
gregoirenovel 2017-05-22 16:55:53 +02:00 committed by Mathieu Magnin
parent 62a73e072b
commit 627ce150a7
2 changed files with 2 additions and 0 deletions

View file

@ -37,6 +37,7 @@
= render partial: "layouts/mailjet_newsletter"
= javascript_include_tag "application", "data-turbolinks-track" => true
= yield :charts_js
- if Rails.env == "test"
%script{ :type => "text/javascript" }
(typeof jQuery !== "undefined") && (jQuery.fx.off = true);

View file

@ -0,0 +1 @@
Chartkick.options[:content_for] = :charts_js