Sunday, March 27, 2005

Rails 0.11.1: More Ajax, Verifications, SQL Server updated, loads of fixes

Posted by admin

The Ajax wave is sweeping across Rails. In this release, we’ve added a :position option to both link_to_remote and form_remote_tag that can be set to either :before, :top, :bottom, or :after. These options make it possible to add new DOM elements to existing lists without replacing the whole list. When working on big lists that are in a fixed order anyway, there’s a considerable speed increase to be had.

Yellow Fade Technique
Additionally, we’ve implemented the first in a hopefully long series of packaged effects. This is the <a href=http://www.37signals.com/svn/archives/000558.php">37signals’ Yellow Fade Technique</a> that’s now available as Effect.Highlight(id) — perfect for highlighting a new element that was just added with Ajax. If you have the Javascript chops to do other effects, please do help out. The wiki discussion page for Ajax in Rails already has great ideas for slide, fadeout, and squish.

Verifications
Verifications in a whole new module for Action Pack that allows you to specify preconditions for you actions. They come in the form of “verify that these parameters are part of the request or redirect the user somewhere else (possibly adding a message to the flash)”. Or said in code:

verify :params => "post", :only => [ :create, :update ], :redirect_to => { :action => "index" }

SQL Server adapter updated
The Micrsoft SQL Server adapter is back in top form supporting both file uploads (albeit still restricted by SQL Server’s 7KB limit) and the new limit style. Thanks to DeLynn Berry for the quick update. Now only the DB2 adapter is not supporting the new limit style.

Loads of fixes
Iconv is no longer required to install Rails (but you’ll want it if you need to send/receive UTF-8 with Action Mailer), you can clone Active Records with floats, the dispatch.fcgi has been fixed, and a bunch of other things. In total, this release has 30 new features, additions, tweaks, and fixes.

See all the changes in the changelogs for Rails, Active Record, Action Pack, Active Support, Action Mailer, and Action Web Service.

Update: No application changes should be required. Just make sure that you copy over the latest prototype.js if you’re using Ajax.

P.S.: Many thanks to Florian Gross for the wonderful code snippet that allows for uploads to RubyForge automatically. This saved me the headache of releasing 12 files by hand one more time. And many thanks to Jamis Buck for the new template used for the API documentation.