Commit c4617c4213541cdb985b240c6a3204c0db1624da
1 parent
28165631
Exists in
master
and in
27 other branches
rails3: search for partial class in reverse order
View paths of plugins is appended at the end of view_paths array.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -304,7 +304,7 @@ module ApplicationHelper |
304 | 304 | def partial_for_class(klass, prefix=nil, suffix=nil) |
305 | 305 | raise ArgumentError, 'No partial for object. Is there a partial for any class in the inheritance hierarchy?' if klass.nil? |
306 | 306 | name = klass.name.underscore |
307 | - controller.view_paths.each do |view_path| | |
307 | + controller.view_paths.reverse_each do |view_path| | |
308 | 308 | partial = partial_for_class_in_view_path(klass, view_path, prefix, suffix) |
309 | 309 | return partial if partial |
310 | 310 | end | ... | ... |