Humanized Attributes
Users aren't robots. So humanize model attributes first on your model .rb file :)
HUMANIZED_ATTRIBUTES = {
:user_first_name => 'First Name',
:user_last_name => 'Last Name'
}
def self.human_attribute_name(attr, options={})
HUMANIZED_ATTRIBUTES[attr.to_sym] || super
end
Written by Pedro Tavares
Related protips
1 Response
What is the point of this ? Could you explain ?
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#