Commit ff01ca9c authored by Connor Shea's avatar Connor Shea

Trying to make this work with sprockets in production.

parent f82278c4
module JavascriptHelper
def page_specific_javascripts(js = nil)
@page_specific_javascripts = js unless js.nil?
@page_specific_javascripts
def page_specific_javascript_tag(js)
javascript_include_tag asset_path(js), {integrity: true, "data-turbolinks-track" => true}
end
end
......@@ -2,8 +2,8 @@
%ul{ class: (container_class) }
- content_for :page_specific_javascripts do
= javascript_include_tag 'lib/chart.js', {integrity: true, "data-turbolinks-track" => true}
= javascript_include_tag 'graphs/application.js', {integrity: true, "data-turbolinks-track" => true}
= page_specific_javascript_tag('lib/chart.js')
= page_specific_javascript_tag('graphs/application.js')
= nav_link(action: :show) do
= link_to 'Contributors', namespace_project_graph_path
= nav_link(action: :commits) do
......
- page_title "Network", @ref
- content_for :page_specific_javascripts do
= javascript_include_tag 'lib/raphael.js', {integrity: true, "data-turbolinks-track" => true}
= javascript_include_tag 'network/application.js', {integrity: true, "data-turbolinks-track" => true}
= page_specific_javascript_tag('lib/raphael.js')
= page_specific_javascript_tag('network/application.js')
= render "projects/commits/head"
= render "head"
%div{ class: (container_class) }
......
- page_title @user.name
- page_description @user.bio
- content_for :page_specific_javascripts do
= javascript_include_tag 'lib/d3.js', {integrity: true, "data-turbolinks-track" => true}
= javascript_include_tag 'users/application.js', {integrity: true, "data-turbolinks-track" => true}
= page_specific_javascript_tag('lib/d3.js')
= page_specific_javascript_tag('users/application.js')
- header_title @user.name, user_path(@user)
- @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