[Rails] Re: How do you use :message with validation?

Ben Lisbakken
Thu, 20 Jul 2006 09:42:52 -0000

Jean-etienne Durand wrote:
> Ben Lisbakken wrote:
>> If I do validates_uniqueness_of :name, :message =>
"It''s not
>> uniqueeee!!!"
>>
>> then how do I have it display that message when the check fails?
>>
>> -Ben Lisbakken
>
> Ben,
>
> You need to use flash messages in your views:
> http://rubyonrails.org/api/classes/ActionController/Flash.html
>
> - Jean-Etienne

That''s a part of it, yes.  That''s how I''ll display
the message... but
I''m referring to the parameter :message in a validates_uniqueness_of
line.  How do I access that after the test fails?