aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index abcc9d4acf..2d58e1440c 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -1,4 +1,22 @@
module ActionController
+ module BasicRendering
+ extend ActiveSupport::Concern
+
+ # Render template to response_body
+ # :api: public
+ def render(*args, &block)
+ super(*args, &block)
+ text = args.first[:text]
+ if text.present?
+ self.response_body = text
+ end
+ end
+
+ def rendered_format
+ Mime::TEXT
+ end
+ end
+
module Rendering
extend ActiveSupport::Concern