Created
December 27, 2010 18:49
-
-
Save ionas/756409 to your computer and use it in GitHub Desktop.
Call via Product.labels(:price)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: do label translation here as well. | |
@@labels = { | |
:price => 'Price incl. VAT' | |
} | |
def self.labels(attribute_name) | |
if @@labels[attribute_name] | |
@@labels[attribute_name] | |
else | |
attribute_name.to_s.titleize | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use like <%= Product.labels :price %>