Sha256: f20659f5b568ee652c3bc9016a83763c61c16f8ed3112e6e4e9ce6dccd430730

Contents?: true

Size: 640 Bytes

Versions: 3

Compression:

Stored size: 640 Bytes

Contents

module AuxiliaryAddons
  module ErrorHelper
    # ::Rails.logger.error("...")

    #
    # Common helpers to error processing
    #
    # Check is error or not for fields
    def is_error_message_on(object, method)
      object = instance_variable_get("@#{object}")
      if object.nil? || !object.errors.on(method)
        return true
      end
      return false
    end

    # Show hint on the fields if error not exists
    def hint_message_on(object, method, hint, css_class = "formHint")
      return if !is_error_message_on(object, method)
      content_tag("div", hint, :class => css_class)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
auxiliary_addons-0.5.6 lib/auxiliary_addons/error_helper.rb
auxiliary_addons-0.5.5 lib/auxiliary_addons/error_helper.rb
auxiliary_addons-0.5.4 lib/auxiliary_addons/error_helper.rb