diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 06f4441609..01dd4ffeb1 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -117,11 +117,14 @@ module AbstractController # The prefixes used in render "foo" shortcuts. def _prefixes prefixes = [controller_path] - parent_controller = self.class.superclass - until parent_controller.abstract? - prefixes << parent_controller.controller_path - parent_controller = parent_controller.superclass + if template_inheritance? + parent_controller = self.class.superclass + + until parent_controller.abstract? + prefixes << parent_controller.controller_path + parent_controller = parent_controller.superclass + end end prefixes @@ -173,5 +176,10 @@ module AbstractController def _process_options(options) end + + def template_inheritance? + # is there a better way to check for config option being set? + config.template_inheritance.nil? ? true : config.template_inheritance + end end end |