Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v6.1.7.7) is shown here.
prompt_option_tag(type, options)
private
Builds a prompt option tag with supplied options or from default options.
prompt_option_tag(:month, prompt: 'Select month')
=> "<option value="">Select month</option>"
# File actionview/lib/action_view/helpers/date_helper.rb, line 1081
def prompt_option_tag(type, options)
prompt = case options
when Hash
default_options = { year: false, month: false, day: false, hour: false, minute: false, second: false }
default_options.merge!(options)[type.to_sym]
when String
options
else
I18n.translate(:"datetime.prompts.#{type}", locale: @options[:locale])
end
prompt ? content_tag("option", prompt, value: "") : ""
end