diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-21 15:55:47 -0200 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-11-01 02:23:48 +0100 |
commit | 0cf16ddb88b4fa28c37e576d50d835b100c3f6a1 (patch) | |
tree | ebc8dd87cc054d9c544a33e27f484205467a939c /actionpack/lib/abstract_controller | |
parent | 2d514e5352d17c8c3958b26397f1c808c7fa0b3c (diff) | |
download | rails-0cf16ddb88b4fa28c37e576d50d835b100c3f6a1.tar.gz rails-0cf16ddb88b4fa28c37e576d50d835b100c3f6a1.tar.bz2 rails-0cf16ddb88b4fa28c37e576d50d835b100c3f6a1.zip |
Improve AbstractController layouts coverage.
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering_controller.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/rendering_controller.rb b/actionpack/lib/abstract_controller/rendering_controller.rb index 9fb7935ce4..07deda77a2 100644 --- a/actionpack/lib/abstract_controller/rendering_controller.rb +++ b/actionpack/lib/abstract_controller/rendering_controller.rb @@ -8,9 +8,7 @@ module AbstractController included do attr_internal :formats - extlib_inheritable_accessor :_view_paths - self._view_paths ||= ActionView::PathSet.new end @@ -99,6 +97,7 @@ module AbstractController end private + # Take in a set of options and determine the template to render # # ==== Options @@ -110,7 +109,7 @@ module AbstractController # _partial<TrueClass, FalseClass>:: Whether or not the file to look up is a partial def _determine_template(options) if options.key?(:text) - options[:_template] = ActionView::TextTemplate.new(options[:text], formats.first) + options[:_template] = ActionView::TextTemplate.new(options[:text], format_for_text) elsif options.key?(:inline) handler = ActionView::Template.handler_class_for_extension(options[:type] || "erb") template = ActionView::Template.new(options[:inline], "inline #{options[:inline].inspect}", handler, {}) @@ -147,6 +146,10 @@ module AbstractController yield end + def format_for_text + Mime[:text] + end + module ClassMethods def clear_template_caches! end |