How does it work? ( in 20 seconds or less )
Within your application's layout file, a call to
behaveJS_bootstrap helper method is placed
of various UI components and promote object-oriented client-side code. Behaviors are then computed, taking into
account the current controller/action, and are integrated into the UI utilizing event delegation. Below is some
sample code utilizing behaveJS Controllers and Behaviors. An example of RemoteActions can be found here.
- Install with
bash > script/plugin install git://github.com/rightscale/behaveJS.git
asset_packages.ymlfile. Either way, make sure that they are added after the inclusion of Prototype.
- Place the following method call
<%= behaveJS_bootstrap %>right after all of your asset includes and you should be good to go!
- Rails 2.1.2, 2.2.2, and 2.3.2 are all compatible. Older versions may be as well, but were not tested.
What exactly does behaveJS provide again?
- Ability to easily override how confirmation messages are displayed in your app
- Peace, Love, and Rock n' Roll!
- See this SBonRails presentation for an overview
And now a word from our sponsors
It's always important to know what exactly the plugins you use in your Rails app do, so don't be shy. Pop open Textmate and take a look around the source. It is fairly documented and even has some tests! wooo!