Plugins - Form Label Helper

StarAdd to favorites

The usage is very simple from the simplest case to more complicated.

* label_tag "First Name", :for => "user_first_name", :accesskey => "F"
* label_for :user, :first_name
* f.label :first_name

I have this helper default to my likings :D. For the exception of the labeltag in which you need to specify an accesskey option if you want it, for labelfor and f.label the default is that the helpers figure out the first possible available letter to be used as access key. So in the previous case the output is:

First Name

labelfor and f.label can take 2 extra parameters beside the usual suspects, :text (string) to be used instead of method.humanize and :skipauto_accesskey (bool) if you don't want to create the accesskey automagically.

Remember to put an entry in your stylesheet and you're good to go. Ex: label kbd{text-decoration: underlined; font-family: inherit; font-size: inherit; font-style: inherit;}

Diego Scataglini

http://jroller.com/page/dscataglini

http://simple-rails-plugins.googlecode.com/svn/form-label-helper/

Rails' (MIT)

  • Currently 4.7/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
Alex G 14 May 2007

Missing support for radio buttons.

Erkki 24 Apr 2007

The same loadhelpers problem is present in this plugin ( http://agilewebdevelopment.com/plugins/relatedselect_forms )

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?