Sha256: 2f8bbb465cb3d11bdd1f8151587c735fc7d5b44b3b96856430113d181daa05fc

Contents?: true

Size: 651 Bytes

Versions: 45

Compression:

Stored size: 651 Bytes

Contents

module RailsConnector
  module ErrorMessagesHelper
    # Shortened error_messages_for from git://github.com/rails/dynamic_form.git
    def error_messages(*objects)
      objects.compact!
      count = objects.inject(0) {|sum, object| sum + object.errors.count }
      return '' if count.zero?

      content_tag(:div, :class => 'errorExplanation') do
        c = ''.html_safe
        c << content_tag(:ul) do
          li = ''.html_safe
          objects.each do |object|
            object.errors.full_messages.each do |msg|
              li << content_tag(:li, msg)
            end
          end
          li
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
infopark_rails_connector-6.9.1.3.22208381 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.9.0.3.197272233 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.174.51542603 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.115.227021242 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.73.75172665 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.2.153416031 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.67.110847540 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.3.1.23895778 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.2.36.82613853 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.2.7.128454143 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.1.26.236500544 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.1 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.539.93842523 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.529.114081979 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.518.30999728 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.515.34928522 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.498.46559598 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.480.261594408 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.444.171626367 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.406.131718077 app/helpers/rails_connector/error_messages_helper.rb