jQuery and Rails


#1

Any jQuery users have an example or info regarding their jQuery
integration
to rails apps?

I’ve found plenty of tutorials and guides on setting up jQuery and doing
some simple UI tasks. But I’d really like to compare my strategies of
using jQ’s ajax (etc.) in Ruby on Rails applications with other users.

Anyone have any examples?

John


#2

I am a member of the jQuery team, and I am currently finishing up work
on the first release of jQuery on Rails, a plugin for Rails that
replaces the built-in prototype stuff with jQuery.

It’s not a 1:1 API rewrite, but rather an attempt to get the jQuery
philosophy of unobtrusive coding into Rails. I will have a release
ready for RailsConf (and I will be there as well).

– Yehuda K.


#3

I just posted about what I’ve figured out so far regarding JQuery Ajax

I discuss how to build JQuery Ajax calls that can interact with a
RESTful controller method with a respond_to block (you need to add the
correct Accept header to the HTTP request before you send), and how to
write JQuery Javascript via RJS – for example:

page["#posts"].append render(:partial => ‘post’, :locals => {:post =>
@post})

outputs:

$("#posts").append(“Post #29 info…”);

… which JQuery can parse and execute successfully.

Interested to hear what others have been able to figure out with
JQuery + Rails integration.

Geoff


#4

Sounds great Yehuda! I was just browsing your blog trying to find your
email address. I look forward to checking out the plugin when it’s
released.

Thanks,

John