Cache controller_path on the AV instance to avoid needing to make additional calls back into the controller for each attempt (this was done because these calls were adding up significantly in partial rendering and showing up on profiles)

This commit is contained in:
Yehuda Katz
2009-08-09 03:06:08 -03:00
parent e28e061165
commit 10eaba8f41

View File

@@ -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