提交 c337e870 编写于 作者: A Aaron Patterson

cache path parts in the instance

上级 8e5b4372
......@@ -163,7 +163,8 @@ class OptimizedUrlHelper < UrlHelper
def initialize(route, options)
super
@arg_size = @route.required_parts.size
@path_parts = @route.required_parts
@arg_size = @path_parts.size
end
def call(t, args)
......@@ -185,7 +186,7 @@ def optimized_helper(args)
true
end
@route.required_parts.each_with_index do |part, i|
@path_parts.each_with_index do |part, i|
# Replace each route parameter
# e.g. :id for regular parameter or *path for globbing
# with ruby string interpolation code
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册