diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-16 23:26:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-16 23:26:29 +0100 |
commit | b1edd096626d6f536b87ff5e307c37a89dd78133 (patch) | |
tree | 10521b97477f883af2cad10cf992ec58ca6d68e6 /actionpack/lib/action_controller | |
parent | 47a236e291f0235a08ce4bb2a2d43fe221794461 (diff) | |
download | rails-b1edd096626d6f536b87ff5e307c37a89dd78133.tar.gz rails-b1edd096626d6f536b87ff5e307c37a89dd78133.tar.bz2 rails-b1edd096626d6f536b87ff5e307c37a89dd78133.zip |
Ensure render :text => resource first tries to invoke :to_text on it
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index 0aae9f8579..0bd362fd64 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -36,6 +36,13 @@ module ActionController super end + def _determine_template(options) + if options.key?(:text) && options[:text].respond_to?(:to_text) + options[:text] = options[:text].to_text + end + super + end + def format_for_text formats.first end |