Yehuda Katz is a member of the Ruby on Rails core team, and lead developer of the Merb project. He is a member of the jQuery Core Team, and a core contributor to DataMapper. He contributes to many open source projects, like Rubinius and Johnson, and works on some he created himself, like Thor.
@olivierlacan sorry :( my office sucks for podcasts; WiFi and rooms. Was the content bad or just the audio? I wish to improve!
jQuery on Rails: A (Still Very Alpha) Update
May 26th, 2007
I’ve made a number of updates to my preliminary release of jQuery on Rails:
- It’s now in svn as part of a demo app, so you can see how it all fits together.
- The new svn URL is http://jqueryjs.googlecode.com/svn/trunk/tools/rails_demo_app for the entire demo, or http://jqueryjs.googlecode.com/svn/trunk/tools/rails_demo_app/vendor/plugins/jquery_on_rails for just the plugin
- I added a number of new JavaScript files to get copied when you install the plugin.
- Your jQuery modules now need to be in app/public/javascripts/jquery_modules, which allows the core library files to be separate from your modules
And the big news…
I’ve written a few proof of concept helpers for jQuery on Rails that come with modules that are automatically installed in jquery_modules.
So far, I wrote one for a tabbed interface and one for sortable tables.
They both take the same settings as the underlying JavaScript libraries. For instance, you can set up the table sorter as follows:
<% sortable_table :sort_class_asc => “ascending”, :sort_class_desc => “descending”, :striping_row_class => ["even", "odd"], :stripe_rows_on_start_up => true do %>
<thead>
<tr>
<th>Col 1</th>
<th>Col 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>jQuery 1.0</td>
<td>$100</td>
</tr>
<tr>
<td>jQuery 1.1</td>
<td>$59</td>
</tr>
<tr>
<td>jQuery 1.1.1</td>
<td>$68</td>
</tr>
<tr>
<td>jQuery 1.1.2</td>
<td>$8</td>
</tr>
</tbody>
<% end %>
This corresponds to:
tableSorter({sortClassAsc: ‘ascending’, sortClassDesc: ‘descending’, stripingRowClass: ['even', 'odd'], stipeRowOnStartup: true})
You can check out both the tablesorter helper and the tabs helper in action by checking out the jQuery on Rails demo app.


Tr0y, Posted May 28, 2007, 5:58 pm
Keep up the good work, I’m really looking forward to using JQuery in Rails. :-)
matt, Posted June 28, 2007, 2:24 pm
freakin’ badass! keep up the good work.
shaggy, Posted September 13, 2007, 3:46 pm
very cool! yes jquery + rails (or merb?)
Paul Irish, Posted September 22, 2007, 5:01 pm
Jeremy Durham seems to have picked up the jquery+rails torch.. http://www.jeremydurham.com/
wycats, Posted September 22, 2007, 5:07 pm
Unfortunately, that plugin uses inline JS via stuff like :onclick, so while it’ll work just fine, it won’t be very jQuery-ish :)
Good luck Jeremy!
Sebastien, Posted October 22, 2007, 7:04 am
checked out the full project.
Now using rails 1.2.5 and Hpricot 0.6
The demo crashes.
When viewing:
http://localhost:3000/rails_demo
Error message begins with:
undefined method `[]' for #
RAILS_ROOT: script/../config/..
...path/to/my/ projects/folder/JQueryDemoApp/vendor/plugins/jquery_on_rails/lib/jqor_control.rb:18:in `get_jquery_files'
This block around line 18 in jqor_control.rb seems quite compilcated. Could’nt it be expanded?
Anyway, Is there a way to solve this bug?