Permalink
Browse files

Ruby 1.9 compat: form helper test

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 79790df commit 5c4469f3a820f0e4475d4a6496539e3c96f82258 @jeremy jeremy committed Dec 21, 2007
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/active_record_helper.rb
@@ -149,7 +149,7 @@ def error_messages_for(*params)
options[:object_name] ||= params.first
options[:header_message] = "#{pluralize(count, 'error')} prohibited this #{options[:object_name].to_s.gsub('_', ' ')} from being saved" unless options.include?(:header_message)
options[:message] ||= 'There were problems with the following fields:' unless options.include?(:message)
- error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }
+ error_messages = objects.sum {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }.join
contents = ''
contents << content_tag(options[:header_tag] || :h2, options[:header_message]) unless options[:header_message].blank?

0 comments on commit 5c4469f

Please sign in to comment.