    # File lib/action_view/helpers/form_options_helper.rb, line 111
          def options_for_select(container, selected = nil)
            container = container.to_a if Hash === container

            options_for_select = container.inject([]) do |options, element|
              if !element.is_a?(String) and element.respond_to?(:first) and element.respond_to?(:last)
                is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element.last) : element.last == selected) )
                if is_selected
                  options << "<option value=\"#{html_escape(element.last.to_s)}\" selected=\"selected\">#{html_escape(element.first.to_s)}</option>"
                else
                  options << "<option value=\"#{html_escape(element.last.to_s)}\">#{html_escape(element.first.to_s)}</option>"
                end
              else
                is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element) : element == selected) )
                options << ((is_selected) ? "<option value=\"#{html_escape(element.to_s)}\" selected=\"selected\">#{html_escape(element.to_s)}</option>" : "<option value=\"#{html_escape(element.to_s)}\">#{html_escape(element.to_s)}</option>")
              end
            end

            options_for_select.join("\n")
          end