method

to_select_tag

Importance_0
v3.2.8 - Show latest stable - 0 notes - Class: ActionView::Helpers::InstanceTag
to_select_tag(choices, options, html_options) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_view/helpers/form_options_helper.rb, line 579
      def to_select_tag(choices, options, html_options)
        selected_value = options.has_key?(:selected) ? options[:selected] : value(object)
        choices = choices.to_a if choices.is_a?(Range)

        # Grouped choices look like this:
        #
        #   [nil, []]
        #   { nil => [] }
        #
        if !choices.empty? && choices.first.respond_to?(:last) && Array === choices.first.last
          option_tags = grouped_options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])
        else
          option_tags = options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])
        end

        select_content_tag(option_tags, options, html_options)
      end
Register or log in to add new notes.