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