Permalink
Browse files

Update _render_options to reflect the fact that they're public

  • Loading branch information...
1 parent bd6b61b commit 70d779aaea719e747b242ad88f1489bf19c6795e @wycats wycats committed Aug 6, 2009
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/lib/action_controller/metal/render_options.rb
@@ -13,7 +13,7 @@ def _write_render_options
<<-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 Json
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,17 +64,17 @@ module Js
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
module Xml
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 RJS
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

0 comments on commit 70d779a

Please sign in to comment.