Sha256: 6d42a7e887710825581becca02552e1aab4760fa2c6e913901e34960e2340923

Contents?: true

Size: 666 Bytes

Versions: 44

Compression:

Stored size: 666 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, "helpers.placeholder")
              .translate
            placeholder ||= @method_name.humanize
            @options[:placeholder] = placeholder
          end
        end
      end
    end
  end
end

Version data entries

44 entries across 43 versions & 8 rubygems

Version Path
actionview-4.2.11.3 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.11.2 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.11.1 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.11 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.10 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.10.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.9 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.9.rc2 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.9.rc1 lib/action_view/helpers/tags/placeholderable.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actionview-4.2.8/lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.8 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.8.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.7.1 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.7 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.7.rc1 lib/action_view/helpers/tags/placeholderable.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.6/lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.6 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.6.rc1 lib/action_view/helpers/tags/placeholderable.rb
actionview-4.2.5.2 lib/action_view/helpers/tags/placeholderable.rb
activejob-lock-0.0.2 rails/actionview/lib/action_view/helpers/tags/placeholderable.rb