Sha256: a12355d03db3d748b94a1622c1e6b389a3405476addec99eabf216e0f977fde2

Contents?: true

Size: 678 Bytes

Versions: 32

Compression:

Stored size: 678 Bytes

Contents

# Just replace the method...
module ActionView
  module Helpers
    class InstanceTag
      def to_label_tag(text = nil, options = {})
        options = options.stringify_keys
        name_and_id = options.dup
        add_default_name_and_id(name_and_id)
        options.delete("index")
        options["for"] ||= name_and_id["id"]
        if text.blank?
          content = method_name.humanize
          if object.class.respond_to?(:human_attribute_name)
            content = object.class.human_attribute_name(method_name)
          end
        else
          content = text.to_s
        end
        label_tag(name_and_id["id"], content, options)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
krasivotokak-russian-0.2.1 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.4 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.5 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.6 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.7 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.8 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.0.9 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.1.0 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.1.1 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.1.2 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.1.3 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.2.0 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.2.1 lib/vendor/i18n_label/lib/i18n_label.rb
yaroslav-russian-0.2.2 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.7 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.6 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.5 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.4 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.3 lib/vendor/i18n_label/lib/i18n_label.rb
russian-0.2.2 lib/vendor/i18n_label/lib/i18n_label.rb