def mark_required(object, attribute)  
      "*" if object.class.validators_on(attribute).map(&:class).include? ActiveModel::Validations::PresenceValidator  
    end
def mark_required(object, attribute)  
      "*" if object.class.validators_on(attribute).map(&:class).include? ActiveModel::Validations::PresenceValidator  
    end
Adds an asterix to the field if it is required.