From 890321e51e0c51f61f9198d247727e98f7485899 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 19 Mar 2009 15:45:48 -0700 Subject: Get very basic layouts working. * Required small architecture change --- actionpack/lib/action_controller/new_base/renderer.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_controller/new_base/renderer.rb') diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index 540924936d..1308537160 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -11,6 +11,11 @@ module ActionController # end # end + def initialize(*) + self.formats = [:html] + super + end + def render(action, options = {}) # TODO: Move this into #render_to_string if action.is_a?(Hash) @@ -23,22 +28,21 @@ module ActionController self.response_body = render_to_string(options) end - - def render_to_string(options) - self.formats = [:html] + def render_to_string(options) unless options.is_a?(Hash) options = {:action => options} end - + if options.key?(:text) _render_text(options) elsif options.key?(:template) template = options.delete(:template) - super(template, false) + super(template) elsif options.key?(:action) template = options.delete(:action).to_s - super(template) + options[:_prefix] = _prefix + super(template, options) end end -- cgit v1.2.3