aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-04 19:49:12 -0700
committerwycats <wycats@gmail.com>2010-04-04 19:58:15 -0700
commit209fb5190b1415633fcd42f7617ff5001669dd27 (patch)
tree57ef13a867e090a6b34eb7f10ffd027968b43ea5 /actionpack/lib
parent723e91e9fd594856aa7bcd38b04d04acd03039be (diff)
downloadrails-209fb5190b1415633fcd42f7617ff5001669dd27.tar.gz
rails-209fb5190b1415633fcd42f7617ff5001669dd27.tar.bz2
rails-209fb5190b1415633fcd42f7617ff5001669dd27.zip
render_to_string should have the identical signature as render
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index b251bd6405..98c8c5fa67 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -89,9 +89,16 @@ module AbstractController
# Normalize arguments, options and then delegates render_to_body and
# sticks the result in self.response_body.
def render(*args, &block)
+ self.response_body = render_to_string(*args, &block)
+ end
+
+ # Raw rendering of a template to a string. Just convert the results of
+ # render_to_body into a String.
+ # :api: plugin
+ def render_to_string(*args, &block)
options = _normalize_args(*args, &block)
_normalize_options(options)
- self.response_body = render_to_body(options)
+ render_to_body(options)
end
# Raw rendering of a template to a Rack-compatible body.
@@ -101,14 +108,6 @@ module AbstractController
_render_template(options)
end
- # Raw rendering of a template to a string. Just convert the results of
- # render_to_body into a String.
- # :api: plugin
- def render_to_string(options={})
- _normalize_options(options)
- render_to_body(options)
- end
-
# Find and renders a template based on the options given.
# :api: private
def _render_template(options) #:nodoc: