public
Description: Adds automated styling of input fields with css classes
Homepage: http://www.pluginaweek.org
Clone URL: git://github.com/pluginaweek/styled_inputs.git
name age message
file .gitignore Fri Jul 04 15:49:31 -0700 2008 Ignore test/app_root/script [obrie]
file CHANGELOG.rdoc Sun Dec 28 14:20:57 -0800 2008 Tag 0.1.1 release [obrie]
file LICENSE Mon Apr 13 18:14:22 -0700 2009 Update license [obrie]
file README.rdoc Wed Jun 25 21:38:22 -0700 2008 Update list of plugin resources to GitHub/Light... [obrie]
file Rakefile Tue Jun 09 20:35:39 -0700 2009 Add gemspec [obrie]
file init.rb Thu Aug 16 22:49:29 -0700 2007 Add documentation Prepare for 0.0.1 release [obrie]
directory lib/ Sun Dec 28 14:18:52 -0800 2008 Don't style hidden inputs [obrie]
file styled_inputs.gemspec Tue Jun 09 20:35:39 -0700 2009 Add gemspec [obrie]
directory test/ Mon Apr 13 18:13:30 -0700 2009 Update tests to reflect output generated by Rai... [obrie]
README.rdoc

styled_inputs

styled_inputs adds automated styling of input fields with css classes.

Resources

API

Bugs

Development

Source

  • git://github.com/pluginaweek/styled_inputs.git

Description

Normally, it is difficult to style inputs without adding classes to them so that you can specify css for each type of input. Since this can become a tedious manual task, styled_inputs automatically adds a classes to each input that is generated either by tag or form helpers. The class that is specified is the type of input being generated.

Usage

Tags

  text_field_tag('name')    # => <input class="text" id="name" name="name" type="text" />
  hidden_field_tag('name')  # => <input class="hidden" id="name" name="name" type="hidden" />

Form helpers

  text_field(:person, :name)    # => <input class="text" id="person_name" name="person[name]" size="30" type="text" />
  hidden_field(:person, :name)  # => <input class="hidden" id="person_name" name="person[name]" type="hidden" />

Testing

Before you can run any tests, the following gem must be installed:

To run against a specific version of Rails:

  rake test RAILS_FRAMEWORK_ROOT=/path/to/rails

Dependencies

  • Rails 2.0 or later