zo_twg
Last Updated: February 25, 2016
·
488
· ordepdev
49eba23cc4b611e2bacd22000a9e08df 7

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
Say Thanks
Respond

1 Response
Add your response

4868
54588 555132027835563 687647376 o

What is the point of this ? Could you explain ?

over 1 year ago ·