Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added installation guide to README.rdoc and removed the plain README
- Loading branch information
1 parent
abe2f8c
commit 17e4a9f
Showing
2 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
= jquery-ujs | ||
|
||
Unobtrusive jQuery with Rails 3 | ||
|
||
== Installation | ||
|
||
jQuery 1.4, 1.4.1 and 1.4.2 can be used. However because of http://jsbin.com/uboxu3/7/ issue it is | ||
recommended to use jQuery 1.4.1. | ||
|
||
=== Step 1 | ||
|
||
Download jQuery from http://docs.jquery.com/Downloading_jQuery and put the file in public/javascripts - for example, the file might be: | ||
|
||
public/javascripts/jquery-1.4.1.min.js | ||
|
||
=== Step 2 | ||
|
||
Copy rails.js from http://github.com/rails/jquery-ujs/raw/master/src/rails.js into public/javascripts - overwriting the prototype one (you can also delete the other prototype files if you don't need them for anything else.) | ||
|
||
=== Step 3 (optional) | ||
|
||
Create an initializer to switch the javascript_include_tag :defaults to use jquery instead of the default prototype helpers. | ||
|
||
file config/initializers/jquery.rb | ||
|
||
module ActionView::Helpers::AssetTagHelper | ||
remove_const :JAVASCRIPT_DEFAULT_SOURCES | ||
JAVASCRIPT_DEFAULT_SOURCES = %w(jquery.js rails.js) | ||
|
||
reset_javascript_include_default | ||
end | ||
|
||
= Testing | ||
|
||
== Installation | ||
|
||
$ gem install bundler | ||
$ bundle install | ||
|
||
== Running tests | ||
|
||
$ bundle exec ruby test/server.rb | ||
|
||
Visit http://localhost:4567 and all the tests should pass. If you want to change any settings then change the settings at the top of test/public/test/settings.js |