jQuery has had a recent set of interesting news, so we thought we should write it up:

jQuery works nicely with Rails.

Geoff Buesing assumed that switching his Rails application from Prototype to jQuery would be a pain, but then discovered that you can write jQuery-formatted Javascript with RJS templates, out-of-the-box, no special helpers or modifications necessary.

The trick is to use the RJS element proxy syntax — page['someid']
– which outputs the Prototype syntax $(’someid’). Just replace
someid with a jQuery selector, and method_missing magic will handle
the arbitrary jQuery methods chained to it.

Some examples:

RUBY:

    page["#posts"].append render(:partial => ‘post’, :locals => {:post =>
    @post})
    #=> $("#posts").append("Post #29 info…");

    page[".hide-this"].hide
    #=> $(’.hide-this’).hide();

    page["#foo"].html("bar").append("baz")
    #=> $("#foo").html("bar").append("baz");

    page["h1"].add_class "make-red"
    #=> $("h1").addClass("make-red");

Ryan Dunphey wanted an OS X dashboard widget to give him “simple, searchable, offline access to the API”, so while on a plane, he developed it.

jQuery Widget

This is great PR: Wordpress 2.2 migrated to jQuery due to Matt reading criticism such as this.

New Plugins

A couple of new plugins include:

Source: Ajaxian
Original Article: http://ajaxian.com/archives/jquery-roundup-rails-wordpress-and-new-plugins

Leave a Reply

You must be logged in to post a comment.



Site Navigation