Skip to content

Instantly share code, notes, and snippets.

@moro
Created October 8, 2008 04:24
Show Gist options
  • Save moro/15445 to your computer and use it in GitHub Desktop.
Save moro/15445 to your computer and use it in GitHub Desktop.
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def javascript_include_file(filename)
if ::Rails.env == "development"
fullpath = File.expand_path("public/javascripts/#{filename}.js", ::Rails.root)
javascript_tag File.read(fullpath)
else
javascript_include_tag filename
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment