diff options
-rw-r--r-- | actionview/lib/action_view/view_paths.rb | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/actionview/lib/action_view/view_paths.rb b/actionview/lib/action_view/view_paths.rb index 6c349feb1d..d96222e6dd 100644 --- a/actionview/lib/action_view/view_paths.rb +++ b/actionview/lib/action_view/view_paths.rb @@ -14,29 +14,24 @@ module ActionView :locale, :locale=, :to => :lookup_context module ClassMethods - def parent_prefixes - @parent_prefixes ||= begin - parent_controller = superclass - prefixes = [] - - until parent_controller.abstract? - prefixes << parent_controller.controller_path - parent_controller = parent_controller.superclass - end - - prefixes + def _prefixes + @_prefixes ||= begin + return _local_prefixes if superclass.abstract? + _local_prefixes + superclass._prefixes end end + + def _local_prefixes + [controller_path] + end end # The prefixes used in render "foo" shortcuts. def _prefixes - @_prefixes ||= begin - parent_prefixes = self.class.parent_prefixes - parent_prefixes.dup.unshift(controller_path) - end + self.class._prefixes end + # LookupContext is the object responsible to hold all information required to lookup # templates, i.e. view paths and details. Check ActionView::LookupContext for more # information. |