Latest Notebook Article

Formtastic 2.1.0.beta1 Released

Published 10 days ago by Justin French

Putting this release together has been a lot of fun. We added Andrew Haines to the core team after a few stellar patches improving documentation and refactoring internals, and the sheer number of pull requests (from tiny documentation changes, through to epic commits) we’re seeing is absolutely fantastic.

The Formtastic 2.1.0.beta1 gem is now available on RubyGems.org, compatible with Rails 3.0.x, 3.1.x and 3.2.x (3.2.0.rc2 at the time of writing).

New Features

  • Added Rails 3.2 compatibility
  • Added a new Actions DSL (f.actions, f.action) — see below for deprecation of the Buttons DSL
  • Added new i18n_localizer configuration, allowing you to use your own localiser class instead of Formtastic::Localizer
  • Added a hidden input before mutli-selects, to allow full clearing of the select (like we do for checkboxes)
  • Added support for integers in a :collection for radio and check_boxes inputs
  • Added support for time inputs with no current value to default render blank inputs rather than pre-selecting the current time
  • Brought back the Form Generator from 1.2.x versions of Formtastic
  • Added support for placeholder text on textareas (text inputs)

Deprecations

  • Deprecated the Buttons DSL (f.buttons, f.commit_button) in favor of the new Actions DSL — see above
  • Removed the previously deprecated :label_method, :value_method & :group_label_method options
  • Removed the previously deprecated :as => :numeric
  • Removed the previously deprecated inline_errors_for and related methods
  • Removed the previously deprecated SemanticFormHelper and SemanticFormBuilder

Fixes

  • Fixed the behavior of :include_blank and :prompt options to be inline with Rails’
  • Fixed that :input_html => { :multiple => true } did not force a single choice select into a multi choice
  • Fixed date, time and datetime legend labels to correspond to the first visible input, rather than the first input (which may be hidden)
  • Fixed that DateInput should treat fragments excluded from :order option as discarded
  • Fixed that the :wrapper_html options could not be reused in the view (like in a with_options block) because they were modified by Formtastic
  • Fixed numerous Mongoid and MongoMapper compatibility issues
  • Fixed that we should be calculating the length of integer columns as bytes
  • Fixed many inputs (date, datetime, time, checkboxes, select & boolean) that did not correctly use the :index option in fields_for
  • Fixed Haml and Slim template indentation
  • Fixed invalid html output for nested inputs with multiple siblings
  • Fixed i18n keys with nested objects
  • Many documentation fixes and improvements
  • A few performance improvements

I’ll be writing more on the new Actions DSL in the future, but it closely follows the patterns of the Inputs DSL, allowing for your own custom actions (pretty buttons, different markup, different labelling, whatever you like). For the moment, there’s some basic documentation of ActionsHelper, which should feel pretty familiar.

Please test this release, please add issues to Github for any bugs WTF moments you have, and spread the word!

In Short

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

Search