Blog

Masters at work...

Ruby on Rails gives us a ton of helper methods to make our life easier. But these method are pretty tightly tied into the Prototype / Scriptaclious librarys. To use the lighter jQuery library, you were forced to ignore the helpers and code your JS by hand. Now it’s easy to add jQuery functionality to your Rails projects.

Enter jRails .

jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.

- Install instructions below -

How to install To install the jRails plugin:

./script/plugin install git://github.com/aaronchi/jrails.git

Then copy the javascript files in the plugin folder to your javascripts directory.

How to use

Just install and go! Once installed, the previous Prototype/script.aculo.us helpers will be replaced by jQuery ones. In order for them to function correctly, just include the appropriate javascript files in the head of your page.

<script src="/javascripts/jquery.js" type="text/javascript"></script> <script src="/javascripts/jquery-ui.js" type="text/javascript"></script> <script src="/javascripts/jrails.js" type="text/javascript"></script>

You can also use the Rails javascript_include_tag helper with :default to load them automagically.

<%= javascript_include_tag :defaults %>

You can get the full scoop on the jRails Website

Filed in Blog

Sorry, comments are closed for this article.

Follow us on Twitter Join us on Facebook

Recent Posts

WF Embed Demo By: codeninja July 8th
HD Video Demo By: codeninja December 10th
Upgrading Gems in Snow Leopard By: codeninja August 30th

From our Customers

Mike Askotzky - TrikePM

I want you to know there are tears of joy coming down my face. Great Job!

Omid Rahmat - THG

[They] work hard, give you good feedback, deliver results, and have an eclectic feature set.

Kenneth Dublin - Learning Pad

Dallas and his team has the upmost professionalism and eye for detail.

Navdeep Raj - SourceN

He is the guy who has tattooed the phrase "Nothing is Impossible" on his forehead!

Paul Janowitz - Sentient

Dallas and his team as Master Web Design are the best I have worked with - period.