foobarfighter / drails
- Source
- Commits
- Network (4)
- Issues (0)
- Downloads (2)
- Wiki (1)
- Graphs
-
Tag:
v1.0.0
commit 331356081a067b3556709368656d8daebf707db9
tree 8461ac58ee67cf8dc238ce9af1ffee6b65b4e862
parent bf666af282982f356a716c3e5772568d8376aedc
tree 8461ac58ee67cf8dc238ce9af1ffee6b65b4e862
parent bf666af282982f356a716c3e5772568d8376aedc
drails /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Feb 22 05:23:36 -0800 2009 | |
| |
CONTRIB | Mon Feb 23 00:04:26 -0800 2009 | |
| |
MIT-LICENSE | Wed Jan 28 00:55:18 -0800 2009 | |
| |
README | Wed Feb 25 22:52:25 -0800 2009 | |
| |
Rakefile | Wed Feb 25 22:52:25 -0800 2009 | |
| |
TODO | Sat Feb 21 01:45:13 -0800 2009 | |
| |
config/ | Sun Feb 22 04:21:58 -0800 2009 | |
| |
generators/ | Sat Feb 21 13:52:58 -0800 2009 | |
| |
init.rb | Wed Feb 25 22:52:25 -0800 2009 | |
| |
install.rb | Wed Feb 25 22:52:25 -0800 2009 | |
| |
installer.rb | Wed Feb 25 22:52:25 -0800 2009 | |
| |
javascripts/ | Wed Feb 25 22:52:25 -0800 2009 | |
| |
lib/ | Wed Feb 25 22:52:25 -0800 2009 | |
| |
spec/ | Wed Feb 25 22:52:25 -0800 2009 | |
| |
tasks/ | Wed Feb 25 22:52:25 -0800 2009 | |
| |
testapp/ | Wed Feb 25 22:52:25 -0800 2009 | |
| |
uninstall.rb | Wed Jan 28 00:55:18 -0800 2009 |
README
drails
=======
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
Installation:
=============
# drails relies on the dojo-pkg gem. Installing this gem can sometimes take a while
gem install dojo-pkg
cd my_rails_app
script/plugin install git://github.com/foobarfighter/drails.git
** NOTE: This also installs the dojo-pkg gem (a package that includes the dojo source code) from rubyforge.
This can sometimes take a while.
How it works:
=============
drails tries not to touch Rails' ruby internals as much as possible by providing a client
side library that provides the same argument interface as Prototype/Scriptaculous. The method
names and objects map to the Prototype/Scriptaculous methods and objects needed for emulating the
RJS helper APIs as well as help with any argument munging that is needed due to inconsistencies
between the Dojo and Prototype/Scriptaculous APIs.
drails overrides Rails' ruby internals only when it needs to in order to call out to drails functions
instead of Prototype/Scriptaculous. This monkey patching is necessary only because Rails/RJS is so
tightly coupled to the Javascript framework that is bundled with it.
Limitations:
============
- drails supports all of the most common Rails helpers, but does not fully support RJS. If there is
a huge demand for this, then I will add the complete RJS implementation, but I'm assuming that most
people that are using Dojo, prefer to right Javascript instead of Ruby generated Javascript.
Copyright (c) 2009 Bob Remeika and others, released under the MIT license
