drails allows you to use RJS with Dojo in your Rails application. It completely replaces the need for Prototype/Scriptaculous in your application and let's you use the powerful Dojo Toolkit as your Javascript library.
Examples:
=========
The best way to see how to use drails helpers is to view the specs. Most people will be interested in prototype_helper_spec.rb and scriptaculous_helper_spec.rb. For a quick taste, here is an example of how you can create an link that replaces the "success_response" div on successful completion of an ajax call with the HTML returned by the server:
<%=link_to_remote "my link", :update => [ :success => "_response" ], :url => { :action => "myaction" }%>
<div id="success_response">...some html to be replaced...</div>
To see the usages for the drails generators for dojo modules, dijits, and build profiles, type this from the command line:
cd my_rails_app; script/generate dojo
drails comes with some handy rake tasks for incorporating dojo builds. To see what is available, type this from the command line.
cd my_rails_app; rake -T | grep drails
http://github.com/foobarfighter/drails/tree/v1.0.0
No comments:
Post a Comment