Fernando,
> Where the messages from errors.add_to_base are stored and how to access
> them in the views?
ActiveRecord stores them in an array. There are several ways you can
get to these for example object.errors.full_messages will return an
array of the full error messages. You may also want to read the
following page from the API
http://api.rubyonrails.org/classes/ActiveRecord/Errors.html
--
Joe Clarke
RailsPlayground.com
On 5/1/06, Fernando Macedo <fxmk@terra.com.br>
wrote:> On a model I have the following simple validator:
>
> def validate
> unless name && name =~ /^\w+$/
> errors.add_to_base("Name is missing")
> end
> end
>
> I would like to display a custom message on my views, without using the
> helper <%= error_messages_for "table" %>
>
> Where the messages from errors.add_to_base are stored and how to access
> them in the views?
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>