# \[ANN\] Dojo Toolbocks - v1.0.0

**URL:** <https://www.ruby-forum.com/t/ann-dojo-toolbocks-v1-0-0/88377>\
**Category:** Rails\
**Created:** [March 10, 2007, 6:52am UTC](https://www.ruby-forum.com/t/ann-dojo-toolbocks-v1-0-0/88377 "2007-03-10T06:52:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nshb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@nshb](https://www.ruby-forum.com/u/nshb)\
**Post date:** [March 10, 2007, 6:52am UTC](https://www.ruby-forum.com/t/ann-dojo-toolbocks-v1-0-0/88377/1 "2007-03-10T06:52:01Z")

</div>

= Dojo\_Toolbocks

The Dojo Toolbocks is a superstar plugin (engine) that provides the  
functionality to include any of the Dojo Toolkit libraries into your  
Ruby on Rails application.

==Dependencies

The dependencies are automatically loaded into your application.

For reference they are:

- Dojo Toolkit v0.4
- Engines v1.2
- Rails v1.2.x

==Installation

1. script/plugin install dojo\_toolbocks

a) If you don’t already have engines installed and configured, then  
you will need to modify the /config/environment.rb file. After the  
“Rails::Initializer.run” add the following line:

config.plugins = [“engines”, “\*”]

1. Add the following line to the main template  
(/app/views/layouts/application.rhtml) between the opening and closing

 tags. Alternatively, you can add it to each individual template as needed.

\<%= javascript\_include\_tag ‘dojo’, :plugin =\> ‘dojo\_toolbocks’ %\>

1. Depending on what libraries you need for the functionality you  
desire, you can use the _dojo\_require_ method either as a tag, or as a  
block as shown in a) and b). This method is to be called within the

 tag. See ==Usage for examples.

==Usage

Here is the full rhtml template for using the Dojo  
Toolbocks::Slideshow, with debugging enabled.

 Dojo Toolbocks: Slideshow Demo \<%= dojo\_config(:debug =\> true) %\> \<%= javascript\_include\_tag 'dojo', :plugin =\> 'dojo\_toolbocks' %\> \<%= dojo\_require ({:script\_tag =\> true}, "dojo.widget.\*", "dojo.widget.SlideShow") %\> ![]()"dojo\_toolbocks") }.join(';') %\>" transitionInterval="700" delay="7000" src="\<%= image\_path('demos/widget/slideshow/1.jpg', :plugin =\> 'dojo\_toolbocks') %\>" imgWidth="400" imgHeight="300" /\> 

a) Debugging

\<%= dojo\_config(:debug =\> true) %\>

b) Library Inclusion: Tag Style

\<%= dojo\_require ({:script\_tag =\> true}, “dojo.widget._", "dojo.lang._”)  
%\>

c) Library Inclusion: Block Style

\<% dojo\_require ({:script\_tag =\> true}, “dojo.widget._", "dojo.lang._”)  
do %\>  
function somethingUseful(todo) {  
// this method does something useful, and is wrapped in the same  
script tag as the library includes  
}  
\<% end %\>

==Bugs

Please report any bugs or feature enhancements to  
[http://dev.toolbocks.com](http://dev.toolbocks.com)

–  
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647  
Vancouver: 604-724-6624

---

<div class="post-metadata">

**Author:** ![nshb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@nshb](https://www.ruby-forum.com/u/nshb)\
**Post date:** [March 10, 2007, 7:58am UTC](https://www.ruby-forum.com/t/ann-dojo-toolbocks-v1-0-0/88377/2 "2007-03-10T07:58:05Z")

</div>

Just put up a website for it as well…

[http://dojo.toolbocks.com](http://dojo.toolbocks.com)

Anyone else out there use Dojo with Ruby on Rails?

On 3/9/07, Nathaniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> a) If you don’t already have engines installed and configured, then  
> \<%= javascript\_include\_tag ‘dojo’, :plugin =\> ‘dojo\_toolbocks’ %\>  
> Toolbocks::Slideshow, with debugging enabled.  
>   
>   
> c) Library Inclusion: Block Style
> 
> Please report any bugs or feature enhancements to [http://dev.toolbocks.com](http://dev.toolbocks.com)
> 
> –  
> Nathaniel Steven Henry Brown
> 
> Toll Free: 1-877-446-4647  
> Vancouver: 604-724-6624

–  
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647  
Vancouver: 604-724-6624
