Skip to content
Custom Error Message Rails plugin
Ruby
Failed to load latest commit information.
lib Updated to support Rails 3.1 Oct 6, 2011
spec Grouped all requires together Jan 22, 2011
.rvmrc Added .rvmrc and Gemfile Mar 29, 2011
Gemfile
Gemfile.lock
LICENSE
README.md Updated README Jan 22, 2011
Rakefile Cleaned out Rakefile and updated to rspec 2.x Dec 17, 2010
custom_error_message.gemspec Updated for 1.1.1 release Oct 6, 2011
init.rb Moved everything to where it's supposed to be Apr 17, 2009

README.md

Custom Error Message

This plugin gives you the option to not have your custom validation error message prefixed with the attribute name.

Rails 3 and Ruby 1.9

Custom Error Message is Rails 3 and Ruby 1.9 compatible

Usage

Sometimes generated error messages don't make sense.

validates_acceptance_of :accepted_terms, :message => 'Please accept the terms of service'

This generates the error message:

Accepted terms Please accept the terms of service

This plugin uses the carat (^) to omit the name of the attribute from error messages:

validates_acceptance_of :accepted_terms, :message => '^Please accept the terms of service'

This now generates:

Please accept the terms of service

CREDITS

This plugin was originally written by David Easley (easleydp@gmail.com)

Something went wrong with that request. Please try again.