提交 15ecf32a 编写于 作者: A Andrew White 提交者: Andrew White

Merge pull request #32175 from bogdanvlviv/express-route_for-as-public-api

Express `ActionDispatch::Routing::UrlFor#route_for` as public api

(cherry picked from commit e764336e)
上级 14873f4c
......@@ -191,7 +191,19 @@ def full_url_for(options = nil) # :nodoc:
end
end
def route_for(name, *args) # :nodoc:
# Allows calling direct or regular named route.
#
# resources :buckets
#
# direct :recordable do |recording|
# route_for(:bucket, recording.bucket)
# end
#
# direct :threadable do |threadable|
# route_for(:recordable, threadable.parent)
# end
#
def route_for(name, *args)
public_send(:"#{name}_url", *args)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册