Specify any dependencies in a method named
js_dependencies (optional). Some default dependencies are defined already as a connivence for prototype and scriptaculous.
In your layout, add
In your views, when you need to use the dialog_box.js library, just include it using the
js helper method this plugin provides. The
js method is an alias for the more verbose
# app/views/users/new.html.erb <% js :dialog_box %> # you can use a string or symbol for the name.
That's it. It's a work in progress, feel free to contribute at http://github.com/arya/js_dependency_manager
Using Google AJAX Libraries
Using this plugin, you can opt to use libraries from their server rather than yours.
You can put it in your environment files (development/production) to differentiate settings for development mode and production.
You can technically also put it in your application helper after
If you set
true, when you do
it will yield
Here is a list of the libraries provided by Google:
- scriptaculous (builder, effects, dragdrop, controls, slider, sound)
If you wish to use the compressed version of the library, you can specify that like this:
Note: compressed versions are not provided for prototype or scriptaculous libraries.
By default, the latest versions of the libraries as of the updating of this plugin are used, but you can specify the version you want yourself like so: