
HTML forms are bread and butter to developers like us at Bootspring. In the early days, Rails provided a number of simple view helper methods to construct form tags. Later, the form_for helper was introduced which made form building a little cleaner but still didn’t push the boundaries of what could be done and, to be blunt, HTML’s form functionality hasn’t improved much since the days of HTML 1.0.
The HTML5 standard has tried to rectify that with nice improvements to forms that have been sorely lacking for years now. These improvements are not directly supported by Rails 2.x’s helpers but you can always code them by hand. Rails 3 recently added support for HTML5 form types.
Formtastic is a nice gem which does try to push the boundaries of what Ruby and Rails can do to make building semantic and well-styled forms as simple as possible. It has a notion of inputs, fields, fieldsets, types and buttons and provides intelligent defaults for all of them based on the current context (e.g. if the model object is new, the button will say “Create” instead of “Update”). HTML5 support is still in the works but should be available very soon after the release of Rails 3.
Tools like HTML5 and Formtastic will make building useful and usable forms in Rails easier than ever. Did I miss anything? Know of or recommend any other libraries for making forms?