blob: 0b15a1130873f0baa725386b68d531da43a3c613 (
plain) (
tree)
|
|
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")
.call
placeholder ||= @method_name.humanize
@options[:placeholder] = placeholder
end
end
end
end
end
end
|