Skip to content

Instantly share code, notes, and snippets.

@tulios
Created April 26, 2014 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tulios/11312128 to your computer and use it in GitHub Desktop.
Save tulios/11312128 to your computer and use it in GitHub Desktop.
asset_pipeline_force_debug_false_only_some_manifest
# Helper that use the same logic as javascript_include_tag ensuring body=0 for the manifests
# Usage: <%= always_no_debug_javascript_include_tag 'manifest' %>
#
def always_no_debug_javascript_include_tag *sources
options = sources.extract_options!.stringify_keys
path_options = options.extract!('protocol').symbolize_keys
sources.uniq.map {|source|
path = path_to_javascript(source, path_options)
path.gsub!(/\?body=1/, "?body=0") if path =~ /\?body=1$/
content_tag(:script, "", {"src" => path}.merge!(options))
}.join("\n").html_safe
end
//= require jquery
//
//= require scope_pre
//= require some_js_1
//= require some_js_2
//= require some_js_3
//= require some_js_4
//= require scope_pos
})(jQuery.noConflict(true));
(function($) {//;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment