Skip to content

Instantly share code, notes, and snippets.

@knuton
Created October 19, 2013 18:53
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 knuton/7059913 to your computer and use it in GitHub Desktop.
Save knuton/7059913 to your computer and use it in GitHub Desktop.
Helper for inlining minified JavaScripts from the Rails Asset Pipeline/Sprockets
def javascript_inline_tag(asset_path)
content_tag(
:script,
raw(Uglifier.new.compile(AppName::Application.assets.find_asset(asset_path).to_s))
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment