Get render :inline working

This commit is contained in:
Yehuda Katz + Carl Lerche 2009-05-01 18:17:08 -07:00
parent 7dd072d333
commit ad2a1b5cb1
3 changed files with 6 additions and 2 deletions

@ -13,7 +13,7 @@ def render_to_body(options)
# render :text => ..., :layout => ...
# or
# render :anything_else
if !options.key?(:text) || options.key?(:layout)
if (!options.key?(:text) && !options.key?(:inline)) || options.key?(:layout)
options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _default_layout
end

@ -17,6 +17,10 @@ def render_to_body(options)
if options.key?(:text)
options[:_template] = ActionView::TextTemplate.new(_text(options))
template = nil
elsif options.key?(:inline)
handler = ActionView::Template.handler_class_for_extension(options[:type] || "erb")
template = ActionView::Template.new(options[:inline], "inline #{options[:inline].inspect}", handler, {})
options[:_template] = template
elsif options.key?(:template)
options[:_template_name] = options[:template]
elsif options.key?(:action)

@ -49,7 +49,7 @@ def process(action, parameters = nil, session = nil, flash = nil, http_method =
@request.session = ActionController::TestSession.new(session) unless session.nil?
@request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash
build_request_uri(action, parameters)
@controller.params.merge!(parameters)
# Base.class_eval { include ProcessWithTest } unless Base < ProcessWithTest
@controller.process_with_test(@request, @response)
end