-
Notifications
You must be signed in to change notification settings - Fork 0
Set custom labels for model attributes in Rails
License
Odaeus/attribute_labels
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Attribute Labels ================ Attribute Labels does what it says on the tin. You can specify text for each attribute that will appear on form labels and validation messages. If validates_presence_of is set for an attribute an asterisk will be suffixed to its form label. Example ======= class Vehicle < ActiveRecord::Base label :wheels => 'Number of wheels', :man_auto => 'Manual or automatic?', :abs => 'ABS' validates_presence_of :wheels end Where AR would normally give you: 'Wheels', 'Man auto', 'Abs' <% form_for(@vehicle) do |f| %> <%= f.label :wheels %> <%= f.text_field :wheels %> <% end %> Will produce: Number of wheels* ______________ Copyright (c) 2008 Andrew France, released under the MIT license.
About
Set custom labels for model attributes in Rails
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published