Skip to content

Instantly share code, notes, and snippets.

@activefx
Created June 25, 2010 22:20
Show Gist options
  • Save activefx/453530 to your computer and use it in GitHub Desktop.
Save activefx/453530 to your computer and use it in GitHub Desktop.
# Configure Rails to use jQuery by default
# Set up a jquery.rb file in config/initializers and add:
ActionView::Helpers::AssetTagHelper.javascript_expansions.clear
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :defaults => ['jquery', 'jquery-ui', 'rails']
# Alternatively use
# ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ['jquery', 'jquery-ui', 'rails']
# and then in the head of your application layout
# javascript_include_tag :jquery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment