forked from jm/rails-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjquery.rb
26 lines (23 loc) · 872 Bytes
/
jquery.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This template installs the jquery as prototype replacement
# from Logan Leger, [email protected]
# http://github.com/lleger/Rails-3-jQuery
# modified by Slava Mikerin
# Deleting old prototype drivers
inside('public/javascripts') do
run "rm -rf controls.js dragdrop.js effects.js prototype.js rails.js"
end
#download latest jquery 1.4+
get "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js", "public/javascripts/jquery.js"
# Downloading latest jQuery drivers
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
# Overriding default expansion
initializer 'jquery.rb', <<-CODE
# Switch the javascript_include_tag :defaults to
# use jQuery instead of the default prototype helpers.
module ActionView::Helpers::AssetTagHelper
@@javascript_expansions[:defaults] =%w(
jquery.js
rails.js
)
end
CODE