Commit ff01ca9c authored by Connor Shea's avatar Connor Shea

Trying to make this work with sprockets in production.

parent f82278c4
module JavascriptHelper module JavascriptHelper
def page_specific_javascripts(js = nil) def page_specific_javascript_tag(js)
@page_specific_javascripts = js unless js.nil? javascript_include_tag asset_path(js), {integrity: true, "data-turbolinks-track" => true}
@page_specific_javascripts
end end
end end
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
%ul{ class: (container_class) } %ul{ class: (container_class) }
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= javascript_include_tag 'lib/chart.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('lib/chart.js')
= javascript_include_tag 'graphs/application.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('graphs/application.js')
= nav_link(action: :show) do = nav_link(action: :show) do
= link_to 'Contributors', namespace_project_graph_path = link_to 'Contributors', namespace_project_graph_path
= nav_link(action: :commits) do = nav_link(action: :commits) do
......
- page_title "Network", @ref - page_title "Network", @ref
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= javascript_include_tag 'lib/raphael.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('lib/raphael.js')
= javascript_include_tag 'network/application.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('network/application.js')
= render "projects/commits/head" = render "projects/commits/head"
= render "head" = render "head"
%div{ class: (container_class) } %div{ class: (container_class) }
......
- page_title @user.name - page_title @user.name
- page_description @user.bio - page_description @user.bio
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= javascript_include_tag 'lib/d3.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('lib/d3.js')
= javascript_include_tag 'users/application.js', {integrity: true, "data-turbolinks-track" => true} = page_specific_javascript_tag('users/application.js')
- header_title @user.name, user_path(@user) - header_title @user.name, user_path(@user)
- @no_container = true - @no_container = true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment