There is a :header_message option on error_messages_for:
:header_message - The message in the header of the error div. Pass nil
or an empty string to avoid the header message altogether. (Default:
"X errors prohibited this object from being saved").
http://api.rubyonrails.org/classes/ActionView/Helpers/ActiveRecordHelper.html#M001282
You could also monkey patch ActionView::Helpers::ActiveRecordHelper if
you want to change the default message across the entire application.
module ActionView
module Helpers
module ActiveRecordHelper
def error_messages_for_with_message_overrides(*params)
options = params.extract_options!.symbolize_keys
options[:header_message] = "My Custom Error Message" unless
options.include?(:header_message)
options[:message] = "" unless options.include?
(:message)
error_messages_for_without_message_overrides(params, options)
end
alias_method_chain :error_messages_for, :message_overrides
end
end
end
Cheers
--
Robert Zotter
Zapient, LLC
Ruby on Rails Development and Consulting
http://www.zapient.com
http://www.fromjavatoruby.com
On Nov 19, 1:11 pm, Petan Cert
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi all,
>
> is there a way how to change this default message "9 errors prohibited
> this user from being saved, There were problems with the following
> fields:" I''d like to be in Czech. Is it possible? Thx. P.
> --
> Posted viahttp://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---