I think, I still missunderstand you. But perhaps this is, what you need:
You want to iterate through errors:
@user.errors.each do |attr, message|
do something with attr and message
end
If you want an array of all full_messages, use:
@user.errors.full_messages
(how they are handling it in this
Bente Pieck wrote in post #978180:
> On 28/01/11 15:54, Paul Bergstrom wrote:
>>
> Did you mean:
> validates :firstname, :presence => {:message => "First name is missing"}
> ?
>
>
> --
> best regards
> Bente Pieck
Yes. But I've also seen alidates :firstname, :presence => true, :message
=> "First
It's more of a basic question. How do I get that single error, in the
simples way? @model.errors..something
--
Posted via http://www.ruby-forum.com/.
--
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
3 matches
Mail list logo