On 19 Mar 2011, at 18:40, Kedar Mhaswade
<kedar.mhaswade-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> I found some questions posted in this regard in the past, but I
> couldn''t find anything conclusive. Hence this post, with two
> questions. This is in context of Rails 3.x.
>
> 2. If it is the former, how do I specify custom messages when a
> particular validation fails? Any examples? What if I need to have
> different messages for different criteria (e.g. with :presence and
> with :format)?
>
Instead of :presence => true you should be able to say :presence => {...}
and specify options for that validation (such as the message) in the hash
Fred> Thanks in advance,
> Kedar
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.