Validate_format_of message

I have validates_format_of :name, :with => my regex, :message =>
“That’s wrong”
The validation works but the message does not get displayed when the
user enters invalid data.
Does anyone have any ideas how to fix it?

Thanks.

On 9 August 2012 17:06, tomkins [email protected] wrote:

I have validates_format_of :name, :with => my regex, :message => “That’s
wrong”
The validation works but the message does not get displayed when the user enters
invalid data.
Does anyone have any ideas how to fix it?

What have you got in the view to show the messages?
Do you get any message at all?
Do other validations generate messages (default or custom)?

Colin

You can test it in the console

rails c

p=YourModel.new
p.valid?
p.errors