On 19 Mar 2011, at 18:40, Kedar Mhaswade <[email protected]> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.