lib/chartkick/helper.rb in chartkick-3.2.0 vs lib/chartkick/helper.rb in chartkick-3.2.1

- old
+ new

@@ -72,18 +72,18 @@ end html = (options.delete(:html) || %(<div id="%{id}" style="height: %{height}; width: %{width}; text-align: center; color: #999; line-height: %{height}; font-size: 14px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif;">Loading...</div>)) % html_vars # js vars js_vars = { - type: klass, # don't convert to JSON, but still escape + type: klass.to_json, id: element_id.to_json, data: data_source.respond_to?(:chart_json) ? data_source.chart_json : data_source.to_json, options: options.to_json } js_vars.each_key do |k| js_vars[k] = chartkick_json_escape(js_vars[k]) end - createjs = "new Chartkick.%{type}(%{id}, %{data}, %{options});" % js_vars + createjs = "new Chartkick[%{type}](%{id}, %{data}, %{options});" % js_vars if defer js = <<JS <script type="text/javascript"#{nonce_html}> (function() {