Skip to content

Instantly share code, notes, and snippets.

@elmariofredo
Created June 5, 2010 21:08
Show Gist options
  • Save elmariofredo/427001 to your computer and use it in GitHub Desktop.
Save elmariofredo/427001 to your computer and use it in GitHub Desktop.
# Switch the javascript_include_tag :defaults to use jQuery instead of
# the default prototype helpers.
# Credits: http://webtech.union.rpi.edu/blog/2010/02/21/jquery-and-rails-3/
# $RAILS_ROOT/config/initalizers/jquery.rb
if ActionView::Helpers::AssetTagHelper.const_defined?(:JAVASCRIPT_DEFAULT_SOURCES)
ActionView::Helpers::AssetTagHelper.send(:remove_const, "JAVASCRIPT_DEFAULT_SOURCES")
end
ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery', 'rails']
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment