diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-06 20:03:59 -0300 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-06 20:03:59 -0300 |
commit | 70d779aaea719e747b242ad88f1489bf19c6795e (patch) | |
tree | 2356b36749cf427171a6c603f38f25f3f6ee09a4 /actionpack/lib/action_controller/metal/render_options.rb | |
parent | bd6b61be88dfe6eb1ff1dcc5c17542d804a842c7 (diff) | |
download | rails-70d779aaea719e747b242ad88f1489bf19c6795e.tar.gz rails-70d779aaea719e747b242ad88f1489bf19c6795e.tar.bz2 rails-70d779aaea719e747b242ad88f1489bf19c6795e.zip |
Update _render_options to reflect the fact that they're public
Diffstat (limited to 'actionpack/lib/action_controller/metal/render_options.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/render_options.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/metal/render_options.rb b/actionpack/lib/action_controller/metal/render_options.rb index 65ee09883e..c6a965472f 100644 --- a/actionpack/lib/action_controller/metal/render_options.rb +++ b/actionpack/lib/action_controller/metal/render_options.rb @@ -13,7 +13,7 @@ module ActionController <<-RUBY_EVAL if options.key?(:#{r}) _process_options(options) - return _render_#{r}(options[:#{r}], options) + return render_#{r}(options[:#{r}], options) end RUBY_EVAL end @@ -52,7 +52,7 @@ module ActionController extend RenderOption register_renderer :json - def _render_json(json, options) + def render_json(json, options) json = ActiveSupport::JSON.encode(json) unless json.respond_to?(:to_str) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? self.content_type ||= Mime::JSON @@ -64,9 +64,9 @@ module ActionController extend RenderOption register_renderer :js - def _render_js(js, options) + def render_js(js, options) self.content_type ||= Mime::JS - self.response_body = js + self.response_body = js.respond_to?(:to_js) ? js.to_js : js end end @@ -74,7 +74,7 @@ module ActionController extend RenderOption register_renderer :xml - def _render_xml(xml, options) + def render_xml(xml, options) self.content_type ||= Mime::XML self.response_body = xml.respond_to?(:to_xml) ? xml.to_xml : xml end @@ -84,7 +84,7 @@ module ActionController extend RenderOption register_renderer :update - def _render_update(proc, options) + def render_update(proc, options) generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(view_context, &proc) self.content_type = Mime::JS self.response_body = generator.to_s |