From aa2d0038127f3b0d25e0f9dbb941c6dd0b2714c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Fri, 2 Aug 2013 15:47:39 +0200 Subject: Fist stab on basic rendering --- actionpack/lib/action_controller/metal/rendering.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actionpack/lib/action_controller/metal') 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 -- cgit v1.2.3