Skip to content

Commit

Permalink
Added installation guide to README.rdoc and removed the plain README
Browse files Browse the repository at this point in the history
  • Loading branch information
samoli authored and stevestmartin committed Sep 7, 2010
1 parent abe2f8c commit 17e4a9f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 17 deletions.
17 changes: 0 additions & 17 deletions README

This file was deleted.

44 changes: 44 additions & 0 deletions README.rdoc
@@ -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

0 comments on commit 17e4a9f

Please sign in to comment.