One way to have complete control over the messages is to use a custom validate
block in the model. e.g. to check that a field is not blank it would be like this:
class MyModel < ActiveRecord::Base
validate do |model|
model.errors.add_to_base("My Custom message") if user.field.blank?
end
end
add_to_base
is intended for adding messages that aren't related to a particular individual field (e.g. if a combination of multiple fields is illegal). This means that the CSS to highlight your invalid field won't get added. You can work arround this by also adding a nil message to the errors for your field e.g.
model.errors.add(:field, nil)
Alternatively, check out custom-err-message plugin - this plugin gives you the option to not have your custom validation error message prefixed with the attribute name.