Skip to content

Instantly share code, notes, and snippets.

@michaeldwan
Created July 6, 2010 05:39
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 michaeldwan/465057 to your computer and use it in GitHub Desktop.
Save michaeldwan/465057 to your computer and use it in GitHub Desktop.
Snippet to include JQuery from Google in production and locally in dev
module BundleHelper
def javascript_dev(*sources)
output = ""
sources = sources.to_a
sources.each do |pair|
output << javascript_src_tag(Rails.env.development? ? "dev/#{pair[0]}" : pair[1], {})
end
output.html_safe
end
end
!!! XML
!!!
%html{ html_attrs }
%head
= javascript_dev ['jquery-1.4.2', "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment