HowTo: Changing the column name in a model for validation

Sample code taken from here.

class User > ActiveRecord::Base

HUMANIZED_ATTRIBUTES = {
:email => “E-mail address”
}

def self.human_attribute_name(attr)
HUMANIZED_ATTRIBUTES[attr.to_sym] || super
end

end

Follow

Get every new post delivered to your Inbox.