提交 aa2d0038 编写于 作者: Ł Łukasz Strzałkowski

Fist stab on basic rendering

上级 2c395923
......@@ -13,6 +13,7 @@ module ActionController
autoload :Middleware
autoload_under "metal" do
autoload :BasicRendering, 'action_controller/metal/rendering'
autoload :Compatibility
autoload :ConditionalGet
autoload :Cookies
......
......@@ -14,6 +14,7 @@ module ActionController
#
metal = Class.new(Metal) do
include AbstractController::Rendering
include ActionController::BasicRendering
end
# Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed
......
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
......
......@@ -80,8 +80,6 @@ def view_renderer
# Render template to response_body
# :api: public
def render(*args, &block)
super(*args, &block)
options = _normalize_render(*args, &block)
self.response_body = render_to_body(options)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册