diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-21 17:47:10 -0200 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-11-01 02:23:48 +0100 |
commit | 03960048616593c249745d1e321dbcc7f0483c76 (patch) | |
tree | e8ef23941eb4e9ea02610921c783504991edfe2a /actionpack/lib/abstract_controller | |
parent | 0cf16ddb88b4fa28c37e576d50d835b100c3f6a1 (diff) | |
download | rails-03960048616593c249745d1e321dbcc7f0483c76.tar.gz rails-03960048616593c249745d1e321dbcc7f0483c76.tar.bz2 rails-03960048616593c249745d1e321dbcc7f0483c76.zip |
Add some basic render_test to AbstractController.
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/layouts.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/rendering_controller.rb | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index f4f1d41360..8293e79b0a 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -195,7 +195,7 @@ module AbstractController def _determine_template(options) super - return if (options.key?(:text) || options.key?(:inline) || options.key?(:partial)) && !options.key?(:layout) + return unless (options.keys & [:text, :inline, :partial]).empty? || options.key?(:layout) layout = options.key?(:layout) ? options[:layout] : :default options[:_layout] = _layout_for_option(layout, options[:_template].details) end diff --git a/actionpack/lib/abstract_controller/rendering_controller.rb b/actionpack/lib/abstract_controller/rendering_controller.rb index 07deda77a2..0aae2b18e9 100644 --- a/actionpack/lib/abstract_controller/rendering_controller.rb +++ b/actionpack/lib/abstract_controller/rendering_controller.rb @@ -118,9 +118,6 @@ module AbstractController options[:_template_name] = options[:template] elsif options.key?(:file) options[:_template_name] = options[:file] - elsif !options.key?(:partial) - options[:_template_name] ||= options[:action] - options[:_prefix] = _prefix end name = (options[:_template_name] || action_name).to_s @@ -138,10 +135,6 @@ module AbstractController view_paths.exists?(name, details, options[:_prefix], options[:_partial]) end - def _prefix - self.class.name.underscore - end - def with_template_cache(name) yield end |