Formtastic 0.9.8

Published 1 April 10 by Justin French

It’s been a long time between drinks, and I’m really not a fan of releasing this much stuff all at once, but Formtastic 0.9.8 is finally here.

Run ./script/generate formtastic if you want to update the stylesheets and configuration files (you have version control, right?).

There’s a heap of fixes and a few tiny new features, but the most important thing to know is that the behaviour of the :selected option has changed to address some bugs and inconsistencies, and that it’s been deprecated due to many issues you can read about in the wiki.

It’s also (still) not Rails 3 compatible, but you may want to try the formtastic-rails3 gem (based off 0.9.7) by Rodrigo Alvarez, who’s been doing a lot of work in his fork for Rails 3 compatibility.

Here’s the CHANGELOG:

  • Deprecated :selected/:checked options, see the wiki page
  • Changed CSS rules for fieldset lists to be more specific
  • Changed radio and checkbox inputs to no longer associate the legend label with the first choice’s input (#101)
  • Changed the generators to use |f| rather than |form| (#151)
  • Changed the behaviour of :selected/:checked options to address several bugs and inconsistencies (#152)
  • Changed CSS for input width property to max-width, allowing a size attribute to still be set
  • Fixed an issue where label_str_method not honoured if the object is an ActiveRecord object
  • Fixed incorrect html class for namespaced objects (”/” replaced with ”_”)
  • Fixed compatibility issue with SearchLogic (#155)
  • Fixed an issue where label_str_method was not being overridden with i18n
  • Fixed a button text issue with Rails 2.x in which human_name on multi-word models returned one word (eg Ticketrequest) (#153)
  • Fixed the behaviour of select inputs when the belongs_to or has_many association has a special :class_name option
  • Fixed line numbers from eval’d code, to help when debugging
  • Fixed CSS issue that hidden fields were not always hidden (Chrome for example) (#209)
  • Fixed and improved CSS with nested fieldsets and legends
  • Fixed date/time inputs where :include_seconds => true
  • Fixed that inline hints were still being rendered on hidden inputs
  • Fixed broken CSS declaration missing a colon
  • Added configuration preferences for row and column attributes on textareas
  • Added semantic_errors helper and CSS (for all errors on an object)
  • Added :filename to the list of @@file_methods, to support carrierwave plugin (#156)
  • Added a Formtastic::LayoutHelper with formtastic_stylesheets helper method for linking to all Formtastic CSS files
  • Added labels option to date/time/datetime fields to customise the label of each part of the set (year, month, etc)
  • Added many improvements to the README and docs

The next stop from here is a little unknown. I’m guessing a release this big might need a patch or two, but I’m considering this a 1.0 candidate. Far too many people are using this gem in production for it not to be considered a 1.0, despite all the features think should be in there.

Once we jump over that hurdle, I hope we move forward pretty quickly.

Finally, Dennis Major has been doing some amazing work in the wiki, check it out!

Options

What is this?

portrait of Justin

This is the online home of Justin French, a designer & web application developer located in Melbourne, Australia. I like finding ways to make things work better. I like clarifying and simplifying. I like to understand how you understand things.

» read more

Subscribe to my feed

Follow me on Twitter

@justinfrench

More Notebook Articles

Show more notebook articles

Search