diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 18:17:08 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 18:17:08 -0700 |
commit | ad2a1b5cb1afb0ea810cfdcac2ba1be95c55f1aa (patch) | |
tree | 6742641152bab4be99a6c032168c7cb067dedfc1 /actionpack | |
parent | 7dd072d333040d2bb1197baa55fddfb9b72053bd (diff) | |
download | rails-ad2a1b5cb1afb0ea810cfdcac2ba1be95c55f1aa.tar.gz rails-ad2a1b5cb1afb0ea810cfdcac2ba1be95c55f1aa.tar.bz2 rails-ad2a1b5cb1afb0ea810cfdcac2ba1be95c55f1aa.zip |
Get render :inline working
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/new_base/layouts.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/new_base/renderer.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/testing/process2.rb | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb index a8e0809ac6..79abe40389 100644 --- a/actionpack/lib/action_controller/new_base/layouts.rb +++ b/actionpack/lib/action_controller/new_base/layouts.rb @@ -13,7 +13,7 @@ module ActionController # 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 diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index f21fd746b7..4c4a74979b 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -17,6 +17,10 @@ module ActionController 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) diff --git a/actionpack/lib/action_controller/testing/process2.rb b/actionpack/lib/action_controller/testing/process2.rb index d9af7add5f..67b5afb9c5 100644 --- a/actionpack/lib/action_controller/testing/process2.rb +++ b/actionpack/lib/action_controller/testing/process2.rb @@ -49,7 +49,7 @@ module ActionController @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 |