diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-05-02 03:21:40 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-05-02 03:21:40 -0300 |
commit | 5e790d368c5d0e89cfd5ef1245e4b131be63716f (patch) | |
tree | fe26ed0a2b3056dd67fe46558abd96712cef67d5 /actionpack/lib/action_controller/base | |
parent | 9f36431f58c406312d0b0317543b7f69107e61e9 (diff) | |
parent | 3be3470fab788856b4559742434f195cc6b1009a (diff) | |
download | rails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.tar.gz rails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.tar.bz2 rails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/lib/action_controller/base')
-rw-r--r-- | actionpack/lib/action_controller/base/base.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base/render.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb index 14c4339c94..99b5963891 100644 --- a/actionpack/lib/action_controller/base/base.rb +++ b/actionpack/lib/action_controller/base/base.rb @@ -817,7 +817,8 @@ module ActionController #:nodoc: end def initialize_template_class(response) - @template = response.template = ActionView::Base.new(self.class.view_paths, {}, self, formats) + @template = ActionView::Base.new(self.class.view_paths, {}, self, formats) + response.template = @template if response.respond_to?(:template=) @template.helpers.send :include, self.class.master_helper_module response.redirected_to = nil @performed_render = @performed_redirect = false diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb index 4286577ec5..cc0d878e01 100644 --- a/actionpack/lib/action_controller/base/render.rb +++ b/actionpack/lib/action_controller/base/render.rb @@ -253,7 +253,8 @@ module ActionController response.content_type ||= Mime::JS render_for_text(js) - elsif json = options[:json] + elsif options.include?(:json) + json = options[:json] json = ActiveSupport::JSON.encode(json) unless json.respond_to?(:to_str) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? response.content_type ||= Mime::JSON |