Agile Web Development

Build it. Launch it. Love it.

Enhanced form tag helper

A simple monkey patch that enhances the core [FormTagHelper][1] by automatically adding CSS class names to each type of form tag. For instance, calling textfieldtag('foo', 'enter some text') will output the following:

<input id="foo" name="foo" class="text" type="text" value="enter some text" />

The rules for what class names are added are fairly simple but there are some special cases.

  1. All input tags will have a class name the same as there type.
  2. password fields get the class name 'text' in addition to 'password'.
  3. textarea tags get the class name 'text'.
  4. select tags are not enhanced.

Vitals

Repository http://lesscode.org/svn/rtomayko/rails/plugins/enhanced-form-tag-helper/
License
Tags Tag_red css form norske
Rating (4 votes)
Created 14 April 2006

Comments

Add a comment