    # File lib/action_view/helpers/form_options_helper.rb, line 286
          def options_for_select(container, selected = nil)
            return container if String === container

            container = container.to_a if Hash === container
            selected, disabled = extract_selected_and_disabled(selected)

            options_for_select = container.inject([]) do |options, element|
              text, value = option_text_and_value(element)
              selected_attribute = ' selected="selected"' if option_value_selected?(value, selected)
              disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
              options << %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}>#{html_escape(text.to_s)}</option>)
            end

            options_for_select.join("\n")
          end