README.md in rjs_helpers-0.0.4 vs README.md in rjs_helpers-1.0
- old
+ new
@@ -3,20 +3,16 @@
RJS Helpers
==============
Some helper methods to perform standard JS library tasks from js.erb without having to write actual javascript
+**Important**: This version was made for use with Rails >= 3.1. If you are using Rails 2.3, please take a look
+ at the `rails2` branch.
+
Installation
============
-As a plugin
------------
-
-To install the plugin in your Rails 2.3 application, simply run
-
- ruby script/plugin install https://github.com/Stex/rjs_helpers.git
-
As a gem
--------
To install `rjs_helpers` as a gem, run
@@ -24,21 +20,17 @@
or put this into your `Gemfile`:
gem 'rjs_helpers'
-
-This will automatically load the Rails helper into all your controllers.
-As explained below, the plugin ships with a default JS adapter for jQuery
-which can be automatically copied to your public/javascripts directory with
-the following line:
+In this version, RJS helpers is built as a Rails engine,
+so the necessary helper methods and assets are automatically loaded into your application.
- ruby script/generate rjs_helpers js
-
-Now you only have to include this js file into your application layout
-and you're good to go.
+You only have to extend your `application.js` file to include the necessary javascript:
+ //= require rjs_helpers
+
Usage
=====
The plugin consists of two parts:
@@ -122,19 +114,12 @@
The optional second parameter can be used to set a top offset. This is e.g. useful
if you have a fixed top navbar (greetings to you, bootstrap).
If `:top` is given as the first argument, the page will simply scroll to the very top (+ offset).
-
-
-
-
-
-
-
-
Examples
========
+
```ruby
= js_update_element @user, :partial => 'user', :object => @user
#=> rjsHelpers.updateElementByDomId('user_123', ...)
#=> jQuery('#user_123').html(...)