github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

foobarfighter / drails

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 46
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Tag: v1.0.0

click here to add a description

click here to add a homepage

  • Branches (2)
    • client_abstraction
    • master
  • Tags (2)
    • v1.0.1
    • v1.0.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A Dojo implementation for the Rails helpers — Read more

  cancel

http://d-rails.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Last minute doc changes; Added dojo.xhrPut and dojo.xhrDelete for restful 
communication 
foobarfighter (author)
Wed Feb 25 22:52:25 -0800 2009
commit  331356081a067b3556709368656d8daebf707db9
tree    8461ac58ee67cf8dc238ce9af1ffee6b65b4e862
parent  bf666af282982f356a716c3e5772568d8376aedc
drails /
name age
history
message
file .gitignore Sun Feb 22 05:23:36 -0800 2009 Ignore rdoc dir [foobarfighter]
file CONTRIB Mon Feb 23 00:04:26 -0800 2009 Fixed bug in field observers where field was no... [foobarfighter]
file MIT-LICENSE Wed Jan 28 00:55:18 -0800 2009 Added specs and override classes for periodical... [foobarfighter]
file README Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
file Rakefile Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
file TODO Sat Feb 21 01:45:13 -0800 2009 Added template support for Dijit generator [foobarfighter]
directory config/ Sun Feb 22 04:21:58 -0800 2009 Added the ability to switch between toolkits in... [foobarfighter]
directory generators/ Sat Feb 21 13:52:58 -0800 2009 Added more to the README files and added exampl... [foobarfighter]
file init.rb Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
file install.rb Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
file installer.rb Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
directory javascripts/ Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
directory lib/ Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
directory spec/ Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
directory tasks/ Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
directory testapp/ Wed Feb 25 22:52:25 -0800 2009 Last minute doc changes; Added dojo.xhrPut and ... [foobarfighter]
file uninstall.rb Wed Jan 28 00:55:18 -0800 2009 Added specs and override classes for periodical... [foobarfighter]
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
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server