Skip to content
bellmyer edited this page Sep 13, 2010 · 3 revisions

Table of Contents

  1. Home – Summary and Installation instructions
  2. Model Usage – How to include blacklist validation in your model
  3. Blacklist Syntax – How to setup your blacklist yaml files, with the various options
  4. Programmatic Changes – Changing your blacklists programmatically

How do I…?

Change the default error message model-wide

# app/models/user.rb

class User < ActiveRecord::Base
    validates_blacklist :message => 'is not a valid value'
end

Change the error message for a specific attribute

# app/models/user.rb

class User < ActiveRecord::Base
    validates_blacklist :attributes => {:name => 'is not a valid name'}
end