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.
build_select(type, select_options_as_html)
private
Builds select tag from date type and HTML select
options.
build_select(:month, "<option value="1">January</option>...")
=> "<select id="post_written_on_2i" name="post[written_on(2i)]">
<option value="1">January</option>...
</select>"
# File actionview/lib/action_view/helpers/date_helper.rb, line 1047
def build_select(type, select_options_as_html)
select_options = {
id: input_id_from_type(type),
name: input_name_from_type(type)
}.merge!(@html_options)
select_options[:disabled] = "disabled" if @options[:disabled]
select_options[:class] = css_class_attribute(type, select_options[:class], @options[:with_css_classes]) if @options[:with_css_classes]
select_html = +"\n"
select_html << content_tag("option", "", value: "", label: " ") + "\n" if @options[:include_blank]
select_html << prompt_option_tag(type, @options[:prompt]) + "\n" if @options[:prompt]
select_html << select_options_as_html
(content_tag("select", select_html.html_safe, select_options) + "\n").html_safe
end