Sha256: 86960deba0caff7cf4f03ec96f689542540445b80c6ae3ca9c776da0dcf19cae

Contents?: true

Size: 673 Bytes

Versions: 55

Compression:

Stored size: 673 Bytes

Contents

module ActionView
  module Helpers
    module Tags # :nodoc:
      module Placeholderable # :nodoc:
        def initialize(*)
          super

          if tag_value = @options[:placeholder]
            placeholder = tag_value if tag_value.is_a?(String)
            method_and_value = tag_value.is_a?(TrueClass) ? @method_name : "#{@method_name}.#{tag_value}"

            placeholder ||= Tags::Translator
              .new(object, @object_name, method_and_value, scope: "helpers.placeholder")
              .translate
            placeholder ||= @method_name.humanize
            @options[:placeholder] = placeholder
          end
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 4 rubygems

Version Path
actionview-5.1.7 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.7.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.6.2 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.7.2 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.6.1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.7.1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.6 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.7 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.5 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.5.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.4 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.6 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.4.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.6.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.3 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.3.rc3 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.5 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.5.rc2 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.1.3.rc2 lib/action_view/helpers/tags/placeholderable.rb
actionview-5.0.5.rc1 lib/action_view/helpers/tags/placeholderable.rb