diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-03-19 15:45:48 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-19 15:45:48 -0700 |
commit | 890321e51e0c51f61f9198d247727e98f7485899 (patch) | |
tree | 19457c8d5e9bff3d3b3b16fc4861964e5297957c /actionpack/lib/action_controller/new_base/renderer.rb | |
parent | 8ab37c76608d7105c47566e79b85fcf72cb11e4b (diff) | |
download | rails-890321e51e0c51f61f9198d247727e98f7485899.tar.gz rails-890321e51e0c51f61f9198d247727e98f7485899.tar.bz2 rails-890321e51e0c51f61f9198d247727e98f7485899.zip |
Get very basic layouts working.
* Required small architecture change
Diffstat (limited to 'actionpack/lib/action_controller/new_base/renderer.rb')
-rw-r--r-- | actionpack/lib/action_controller/new_base/renderer.rb | 16 |
1 files changed, 10 insertions, 6 deletions
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 |