URL For
将 url_for
纳入主机类(例如抽象控制器或邮件发送器)。该类必须通过实现 _routes
方法提供 RouteSet
。否则,将引发异常。
请注意,此模块完全与 HTTP 分离 - 唯一要求是有效的 _routes
实现。
命名空间
方法
- #
包含的模块
实例公共方法
_routes() 链接
源代码:显示 | 在 GitHub 上
# File actionpack/lib/abstract_controller/url_for.rb, line 16 def _routes raise "In order to use #url_for, you must include routing helpers explicitly. " \ "For instance, `include Rails.application.routes.url_helpers`." end