Probably a recent documentation, the API docs are not updated often.

2010/1/4 George <george.og...@gmail.com>

> On Sun, Jan 3, 2010 at 6:30 PM, Ben Munat <bmu...@gmail.com> wrote:
>
>>
>> If that does exist in Rails 2.x.x somewhere I would really appreciate a
>> pointer.
>>
>>
> It's not on api.rubyonrails.org for some reason, but here's the rdoc for
> AR::Error#generate_full_message:
>
>       # Wraps an error message into a full_message format.
>       #
>       # The default full_message format for any locale is
> <tt>"{{attribute}} {{message}}"</tt>.
>       # One can specify locale specific default full_message format by
> storing it as a
>       # translation for the key
> <tt>:"activerecord.errors.full_messages.format"</tt>.
>       #
>       # Additionally one can specify a validation specific error message
> format by
>       # storing a translation for
> <tt>:"activerecord.errors.full_messages.[message_key]"</tt>.
>       # E.g. the full_message format for any validation that uses :blank as
> a message
>       # key (such as validates_presence_of) can be stored to
> <tt>:"activerecord.errors.full_messages.blank".</tt>
>       #
>       # Because the message key used by a validation can be overwritten on
> the
>       # <tt>validates_*</tt> class macro level one can customize the
> full_message format for
>       # any particular validation:
>       #
>       #   # app/models/article.rb
>       #   class Article < ActiveRecord::Base
>       #     validates_presence_of :title, :message => :"title.blank"
>       #   end
>       #
>       #   # config/locales/en.yml
>       #   en:
>       #     activerecord:
>       #       errors:
>       #         full_messages:
>       #           title:
>       #             blank: This title is screwed!
>
> George.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscr...@googlegroups.com<rubyonrails-core%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>



-- 
Ryan Bigg

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-c...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.


Reply via email to