I’m going to make humanized name for Devise’s each field by adding followings to User model:
HUMANIZED_ATTRIBUTES = {
:sex => "some_other_text",
:age => "some_other_text"
}
def self.human_attribute_name(attr)
HUMANIZED_ATTRIBUTES(attr.to_sym) || super
end
However, I’m getting error message saying…
undefined method `HUMANIZED_ATTRIBUTES' for #<Class:0x007f8201f39c80>
How can I solve this issue?
You are referencing the hash incorrectly. It uses
[]not().