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.8.0.356.19698103 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.348.160665197 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.328.4a753fc app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.322.c003f11 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.210.ed204b0 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.110.6570b45 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.72.d18d096 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.23.da7f96b app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.16.def5e85 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.15.a24f5ff app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.891.647580e app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.889.d503e42 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.883.f5f063b app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.884.4bd86e6 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.869.9609b39 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.856.8c0fec5 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.809.bdfa8c3 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.785.05d4af9 app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.744.99f67fc app/helpers/rails_connector/error_messages_helper.rb
infopark_rails_connector-6.8.0.beta.200.720.44fbabd app/helpers/rails_connector/error_messages_helper.rb