diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-08 16:32:40 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-08 16:32:40 +0100 |
commit | 68cda695da27f57cae682d160a13dab4dacb1ef8 (patch) | |
tree | 3a3aedb66bc64e4e70220b3f051cd71356373226 /actionpack/lib/abstract_controller | |
parent | 44ebab96da0ab47cc45c64a6efdd2cbb80f9d042 (diff) | |
download | rails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.gz rails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.bz2 rails-68cda695da27f57cae682d160a13dab4dacb1ef8.zip |
Speed up performance in resolvers by adding fallbacks just when required.
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 356f1ec7f6..840f0b6c78 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -142,8 +142,8 @@ module AbstractController private - # Normalize options, by converting render "foo" to render :template => "prefix/foo" - # and render "/foo" to render :file => "/foo". + # Normalize options by converting render "foo" to render :action => "foo" and + # render "foo/bar" to render :file => "foo/bar". def _normalize_args(action=nil, options={}) case action when NilClass @@ -151,14 +151,8 @@ module AbstractController options, action = action, nil when String, Symbol action = action.to_s - case action.index("/") - when NilClass - options[:action] = action - when 0 - options[:file] = action - else - options[:template] = action - end + key = action.include?(?/) ? :file : :action + options[key] = action else options.merge!(:partial => action) end |