Permalink
Browse files

Get render :inline working

  • Loading branch information...
1 parent 7dd072d commit ad2a1b5cb1afb0ea810cfdcac2ba1be95c55f1aa Yehuda Katz + Carl Lerche committed May 2, 2009
@@ -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

0 comments on commit ad2a1b5

Please sign in to comment.