Tue Aug 01 03:17:00 UTC 2006
Here's a full list of changes and additions:
- UPDATED: register_js_behaviour remains as an alias for backwards compatibility but is officially deprecated; it will probably be removed in the next release. There are also aliases for the American spelling of behaviour for our friends on the other side of the pond.
link_to_remote, button_to_function, link_to_function, form_remote_tagetc.) now work out of the box.
- NEW: There is no need to explicitly specify an HTML ID for the elements you want to attach behaviour to - if you don't, one will be generated automatically for you.
- NEW: Options to render behaviour rules directly in your page inside script blocks instead of in the external behaviour file.
- FIXED: Behaviours inside AJAX-loaded partials will now work.
- UPDATED: Behaviours can now cancel the default action by returning false as well as using Event.stop(event). This also works properly in Safari.
- NEW: Documentation!
There is currently only one known issue:
- Behaviours are not being reapplied after an AJAX request in Opera 9
Here's a look at some of the new features, starting with writing behaviours using pure Ruby:
<% apply_behaviour "#mylink:click" do |page, element| page.alert "You clicked me! Now watch me fade..." element.visual_effect :fade end %>
Attaching behaviours directly to elements with
<%= content_tag "div", "My funky box", :onclick => "alert('Hello World!')" %>
We want you to really put this release through its paces - does it conflict with other plugins? Does it cause unexpected problems with Rails itself? Are there any other features you'd like to see? The place to report these feature requests and bugs is of course the Agile Evolved Open Source Trac.
$ svn propedit svn:externals vendor/plugins
Then add the following line to it:
So what do we have planned for 0.3? More patches to Rails' more complicated built-in helpers, such as
apply_behaviour how about some of this:
<% apply_behaviour "div.draggable", make_draggable %> <% apply_behaviour "li.sortable", make_sortable %> <% apply_behaviour "#searchbox", make_autocomplete %>