Created
July 6, 2010 05:39
-
-
Save michaeldwan/465057 to your computer and use it in GitHub Desktop.
Snippet to include JQuery from Google in production and locally in dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 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