diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-03 06:32:55 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-03 06:32:55 -0700 |
commit | 8436620cb519c0c808fdd006c7c276146fb3b005 (patch) | |
tree | 964ea60d5ccd73db9df2fdb47665b9e319488b1c /actionpack/lib/action_controller/metal/rendering.rb | |
parent | e3b695331d95022f9b41faf131f8e98cdf4f6985 (diff) | |
parent | eddf367b8948d23f65a68a27a8bd3071e8a3d48d (diff) | |
download | rails-8436620cb519c0c808fdd006c7c276146fb3b005.tar.gz rails-8436620cb519c0c808fdd006c7c276146fb3b005.tar.bz2 rails-8436620cb519c0c808fdd006c7c276146fb3b005.zip |
Merge pull request #12121 from strzalek/move-methods-to-abs-controller
Move glue methods & BasicRendering to AbstractController
Diffstat (limited to 'actionpack/lib/action_controller/metal/rendering.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 21224b9c3b..abcc9d4acf 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -1,36 +1,4 @@ module ActionController - # Basic rendering implements the most minimal rendering layer. - # It only supports rendering :text and :nothing. Passing any other option will - # result in `UnsupportedOperationError` exception. For more functionality like - # different formats, layouts etc. you should use `ActionView` gem. - module BasicRendering - extend ActiveSupport::Concern - - # Render text or nothing (empty string) to response_body - # :api: public - def render(*args, &block) - super(*args, &block) - opts = args.first - if opts.has_key?(:text) && opts[:text].present? - self.response_body = opts[:text] - elsif opts.has_key?(:nothing) && opts[:nothing] - self.response_body = " " - else - raise UnsupportedOperationError - end - end - - def rendered_format - Mime::TEXT - end - - class UnsupportedOperationError < StandardError - def initialize - super "Unsupported render operation. BasicRendering supports only :text and :nothing options. For more, you need to include ActionView." - end - end - end - module Rendering extend ActiveSupport::Concern |