def hints_for(attribute)
      result = Array.new
      @base.class.validators_on(attribute).map do |v|
        validator = v.class.to_s.split('::').last.underscore.gsub('_validator','')
        if v.options[:message].is_a?(Symbol)
          message_key =  [validator, v.options[:message]].join('.') # if a message was supplied as a symbol, we use it instead
          result << generate_message(attribute, message_key, v.options)
        else
          message_key =  validator
          message_key =  [validator, ".must_be_a_number"].join('.') if validator == 'numericality' # create an option for numericality; the way YAML works a key (numericality) with subkeys (greater_than, etc etc) can not have a string itself. So we create a subkey for numericality
          result << generate_message(attribute, message_key, v.options) unless VALIDATORS_WITHOUT_MAIN_KEYS.include?(validator)
          v.options.each do |o|
            if MESSAGES_FOR_OPTIONS.include?(o.first.to_s)
              count = o.last
              count = (o.last.to_sentence if %w(inclusion exclusion).include?(validator)) rescue o.last
              result << generate_message(attribute, [ validator, o.first.to_s ].join('.'), { :count => count } )
            end
          end
        end
      end
      result
    end
def hints_for(attribute)
      result = Array.new
      @base.class.validators_on(attribute).map do |v|
        validator = v.class.to_s.split('::').last.underscore.gsub('_validator','')
        if v.options[:message].is_a?(Symbol)
          message_key =  [validator, v.options[:message]].join('.') # if a message was supplied as a symbol, we use it instead
          result << generate_message(attribute, message_key, v.options)
        else
          message_key =  validator
          message_key =  [validator, ".must_be_a_number"].join('.') if validator == 'numericality' # create an option for numericality; the way YAML works a key (numericality) with subkeys (greater_than, etc etc) can not have a string itself. So we create a subkey for numericality
          result << generate_message(attribute, message_key, v.options) unless VALIDATORS_WITHOUT_MAIN_KEYS.include?(validator)
          v.options.each do |o|
            if MESSAGES_FOR_OPTIONS.include?(o.first.to_s)
              count = o.last
              count = (o.last.to_sentence if %w(inclusion exclusion).include?(validator)) rescue o.last
              result << generate_message(attribute, [ validator, o.first.to_s ].join('.'), { :count => count } )
            end
          end
        end
      end
      result
    end
Pass in the instance of the object that is using the errors object.

   class Person
     def initialize
       @errors = ActiveModel::Errors.new(self)
     end
   end