diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-05-28 09:49:02 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-05-28 09:49:02 -0500 |
commit | de203245afd2bbf7f93f3241fcf3a71a88101d47 (patch) | |
tree | 3fbae223e10f0e50da6d9fdfc2c70a742c34ac26 /actionpack/lib/action_controller/new_base/render_options.rb | |
parent | dd98280e38d640f5724887cf8a715b79f0439d2d (diff) | |
download | rails-de203245afd2bbf7f93f3241fcf3a71a88101d47.tar.gz rails-de203245afd2bbf7f93f3241fcf3a71a88101d47.tar.bz2 rails-de203245afd2bbf7f93f3241fcf3a71a88101d47.zip |
Revert "Revert "Whitespace!""
This reverts commit 0cac68d3bed3e6bf8ec2eb994858e4a179046941.
Diffstat (limited to 'actionpack/lib/action_controller/new_base/render_options.rb')
-rw-r--r-- | actionpack/lib/action_controller/new_base/render_options.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/new_base/render_options.rb b/actionpack/lib/action_controller/new_base/render_options.rb index 48575ec0bd..f12198a710 100644 --- a/actionpack/lib/action_controller/new_base/render_options.rb +++ b/actionpack/lib/action_controller/new_base/render_options.rb @@ -1,12 +1,12 @@ module ActionController module RenderOptions extend ActiveSupport::DependencyModule - + included do extlib_inheritable_accessor :_renderers self._renderers = [] end - + module ClassMethods def _write_render_options renderers = _renderers.map do |r| @@ -17,25 +17,25 @@ module ActionController end RUBY_EVAL end - + class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def _handle_render_options(options) #{renderers.join} end RUBY_EVAL end - + def _add_render_option(name) _renderers << name _write_render_options end end - + def render_to_body(options) _handle_render_options(options) || super end end - + module RenderOption extend ActiveSupport::DependencyModule @@ -53,13 +53,13 @@ module ActionController module Json include RenderOption register_renderer :json - + 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 self.response_body = json - end + end end module Js |