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_localizerconfiguration, allowing you to use your own localiser class instead ofFormtastic::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
:collectionforradioandcheck_boxesinputs - 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 (
textinputs)
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_methodoptions - Removed the previously deprecated
:as => :numeric - Removed the previously deprecated
inline_errors_forand related methods - Removed the previously deprecated
SemanticFormHelperandSemanticFormBuilder
Fixes
- Fixed the behavior of
:include_blankand:promptoptions 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
:orderoption as discarded - Fixed that the
:wrapper_htmloptions could not be reused in the view (like in awith_optionsblock) 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
:indexoption infields_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!
Previous Notebook Articles
Sharing Todo Lists with iOS 5's Reminders app
Published 102 days ago by Justin French
Talking to Your Customers
Published 108 days ago by Justin French
Formtastic 2.0
Published 124 days ago by Justin French
Head, Heart & Hand
Published 137 days ago by Justin French