wood burning stoves*
The moose likes Ruby and the fly likes Integrating Rails with client side technologies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Integrating Rails with client side technologies" Watch "Integrating Rails with client side technologies" New topic
Author

Integrating Rails with client side technologies

jayan muralidharan
Greenhorn

Joined: Sep 05, 2006
Posts: 1
I've new to ruby and rails. This could be an absurd question. Still, let me ask. How easy is it to integrate javascript toolkits like scriptaculous, dojo, mochikit with rails?

[Edit to provide a meaningful topic - Dave]
[ January 29, 2007: Message edited by: David O'Meara ]
Vivek S. kumar
Greenhorn

Joined: Dec 19, 2006
Posts: 25
well a lot of features and functionality is provided for the integrations with rails. you can pick up resources from net and can do a start.


"Make Your Own Rules and Rock The World"
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by jayan muralidharan:
I've new to ruby and rails. This could be an absurd question. Still, let me ask. How easy is it to integrate javascript toolkits like scriptaculous, dojo, mochikit with rails?

At least Dojo is a pure JavaScript frameworks (as opposed to JavaScript plus a server-side backend in Java/PHP/etc.), which makes "integrating" it a matter of including the appropriate <script src="..."/> tag in your HTML template--and then using the library.

Scriptaculous and Prototype are, by the way, included in the Rails distribution itself so no need to explicitly integrate them...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Justin Gehtland
author
Ranch Hand

Joined: Jan 30, 2007
Posts: 31
As the previous poster pointed out, Prototype and Script.aculo.us are distributed as part of Rails. In addition, Rails itself has helpers to make them easier to integrate. If you wanted to create a hyperlink which, when clicked, executes an Ajax call instead of redirecting the user, you can simply do this in your view:



There are Rails helpers for most of the Prototype and Script.aculo.us features.

Other pure JavaScript toolkits, like Rico, Mochikit, Dojo, jQuery, etc., are easily inluded into your projects, but there are not built-in helpers libraries for them. However, helpers are not hard to write, and I wouldn't be surprised to see that people have already distributed some helpers for some other toolkits. If you are comfortable writing JavaScript directly, though, just include the libraries into your app and have at it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Integrating Rails with client side technologies