full_messages format customization
Reported by Maxim Kulkin | March 15th, 2009 @ 04:55 PM
Rails allows customizing error messages for particular attribute of particular model, but #full_messages return error strings in form "{{human_attribute_name}} {{message}}".
It would be nice to allow customizing full_message the same way as error messages are customized: instead of @@@ruby full_messages << attr_name + ' ' + message
have something like this:
@@@ruby
defaults = @base.class.self_and_descendents_from_active_record.collect do |klass|
:"models.#{klass.name.underscore}"
end
defaults << "full_error_message"
options = {
:attribute => attr_name,
:message => message,
:default => defaults,
:scope => [:activerecord, :errors]
}
full_message << I18n.t(:full_error_message, options)
This will allow customizing full error message like this: @@@yaml en: :activerecord
:errors:
:full_error_message: Field "{{attribute}}" {{message}}
Comments and changes to this ticket
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
ActiveRecord is an insanely easy to use database framework written in objective-c It's obviously "inspired" by (copying) the infamous ActiveRecord that comes with Rails(http://rubyonrails.org) But it tries to be more versatile when it comes to working with multiple connections.