If you look at the Rails API, you can see the the source of the method:
def error_messages_for(object_name, options = {})
options = options.symbolize_keys
object = instance_variable_get("@#{object_name}")
if object && !object.errors.empty?
content_tag("div",
content_tag(
options[:header_tag] || "h2",
"#{pluralize(object.errors.count, "error")} prohibited this
#{object_name.to_s.gsub("_", " ")} from being saved"
) +
content_tag("p", "There were problems with the following
fields:") +
content_tag("ul", object.errors.full_messages.collect { |msg|
content_tag("li", msg) }),
"id" => options[:id] || "errorExplanation",
"class" => options[:class] || "errorExplanation"
)
else
""
end
end
Modify this and override it, or just modify the file in place:
vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb
Marty Jansen wrote:> I have a problem with translation of english phrase when an input error
> occurs. When I put: error_messages_for("registratie") above my
view. I
> get the error: "xx errors prohibited this registratie from being
saved".
>
> The problem now is, the site is for dutch customers and I would like to
> translate this to a dutch phrase. I know I can translate the individual
> fields with the :message attribuut. But how can i customize errors on a
> level higher? Is there some file in the rails directory wich I can
> adjust? Can I just override it somewhere in my rails application?
>
> I searched at google but couldnt find something usefull
>
> Thnx in advance.
>
>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---