diff options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index d1cd506dde..c3361c9367 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -195,7 +195,9 @@ module ActionView #:nodoc: attr_internal :request, :layout - delegate :controller_path, :to => :controller, :allow_nil => true + def controller_path + @controller_path ||= controller && controller.controller_path + end delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers, :flash, :action_name, :controller_name, :to => :controller |