提交 e38ea982 编写于 作者: J Joshua Peek

Unused RouteSet#url_for is hogging a good method name

上级 7db80f87
......@@ -235,31 +235,22 @@ def install_helpers(destinations = [ActionController::Base, ActionView::Base], r
named_routes.install(destinations, regenerate_code)
end
def url_for
@url_for ||= begin
router = self
Module.new do
extend ActiveSupport::Concern
include UrlFor
define_method(:_router) { router }
end
end
end
def url_helpers
@url_helpers ||= begin
router = self
Module.new do
extend ActiveSupport::Concern
include router.url_for
include UrlFor
# ROUTES TODO: install_helpers isn't great... can we make a module with the stuff that
# we can include?
# Yes plz - JP
included do
router.install_helpers(self)
end
define_method(:_router) { router }
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册