class Client < ActiveRecord::Base validates_presence_of :name, :zip, :address, :city, :phone_number # only change the humanized text for zip and name. The other attributes will still be humanized # just as they normally would. HUMANIZED_COLUMNS = {:zip => "Postal code", :name => "Company contact name"} def self.human_attribute_name(attribute) HUMANIZED_COLUMNS[attribute.to_sym] || super end end # Normally if we try to save a record without a name we would get the error message: # Name can't be blank # Using this method to change the humanized text we now get: # Company contact name can't be blank