Skip to content
Browse files

Fist stab on basic rendering

  • Loading branch information...
1 parent 2c39592 commit aa2d0038127f3b0d25e0f9dbb941c6dd0b2714c3 @lukaszx0 lukaszx0 committed Aug 2, 2013
View
1 actionpack/lib/action_controller.rb
@@ -13,6 +13,7 @@ module ActionController
autoload :Middleware
autoload_under "metal" do
+ autoload :BasicRendering, 'action_controller/metal/rendering'
autoload :Compatibility
autoload :ConditionalGet
autoload :Cookies
View
1 actionpack/lib/action_controller/base.rb
@@ -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
View
18 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
View
2 actionview/lib/action_view/rendering.rb
@@ -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

0 comments on commit aa2d003

Please sign in to comment.
Something went wrong with that request. Please try again.