# File lib/action_controller/base.rb, line 569
      def render(options = {}, deprecated_status = nil) #:doc:
        # puts "Rendering: #{options.inspect}"
        raise DoubleRenderError if performed?

        # Backwards compatibility
        return render({ :template => options || default_template_name, :status => deprecated_status }) if !options.is_a?(Hash)

        add_variables_to_assigns
        options[:status] = (options[:status] || DEFAULT_RENDER_STATUS_CODE).to_s

        if options[:text]
          @response.headers["Status"] = options[:status]
          @response.body = options[:text]
          @performed_render = true
          return options[:text]

        elsif options[:file]
          assert_existance_of_template_file(options[:file]) if options[:use_full_path]
          logger.info("Rendering #{options[:file]} (#{options[:status]})") unless logger.nil?
          render(options.merge({ :text => @template.render_file(options[:file], options[:use_full_path])}))

        elsif options[:template]
          render(options.merge({ :file => options[:template], :use_full_path => true }))

        elsif options[:inline]
          render(options.merge({
            :text =>
              @template.render_template(
                options[:type] || :rhtml,
                options[:inline],
                options[:locals] || {}
              )
          }))

        elsif options[:action]
          render(options.merge({ :template => default_template_name(options[:action]) }))

        elsif options[:partial] && options[:collection]
          render(options.merge({ 
            :text => (
              @template.render_partial_collection(
                options[:partial] == true ? default_template_name : options[:partial],
                options[:collection], options[:spacer_template],
                options[:locals] || {}
              ) || ''
            )
          }))

        elsif options[:partial]
          render(options.merge({ :text => @template.render_partial(
            options[:partial] == true ? default_template_name : options[:partial],
            options[:object], options[:locals] || {}
          ) }))
          
        elsif options[:nothing]
          render(options.merge({ :text => "" }))

        else
          render(options.merge({ :action => action_name }))
        end
      end