Rails is a great framework, especially for writing AJAX applications, but the Javascript that the built-in Rails helpers output is a bone of contention for many. Unobtrusive Javascript for Rails aims to change that. Get started now.

What's New

UJS Google Group

Introducing the new UJS google group for support and discussion.

Read more »

Recently

Grab the latest release of the UJS Rails Plugin:

script/plugin install http://source.ujs4rails.com/current/unobtrusive_javascript

UJS Requires Prototype 1.5.0 RC0 or greater

What can you do with the UJS for Rails Plugin?

Define your page behaviours using CSS-style selectors and Ruby

UJS for Rails makes it easy to apply behaviour to your page. Simply specify the element(s) of your page that you want the behaviour to apply to using CSS-style selectors and the event that you want to trigger the behaviour, and the Javascript that you want to run. In addition, you can write your behaviours using RJS-style Ruby to Javascript proxies.

Use built-in Rails Javascript and AJAX helpers unobtrusively out of the box

If you need to retrofit an existing application with unobtrusive behaviour or you are used to using the Rails JavaScript Helpers then that's not a problem. UJS for Rails has upgraded the Rails JavaScript Helpers so they apply their JavaScript unobtrusively. Simply work the same way you always have done and UJS for Rails will handle it for you.

Apply script.aculo.us effects unobtrusively and easily

UJS for Rails comes with its own range of helpers for use with the built-in apply_behaviour function. Now you can easily make unobtrusive sortable lists, draggable elements, in-place editors and much more! All of the UJS helpers automatically apply the necessary behaviours required for the effect you want to achieve - no more ugly inline Javascript clogging up your XHTML!