最佳答案
Rails用命名路由定义了一堆神奇的东西,它们为你的路由提供了帮助。有时候,特别是对于嵌套路由,跟踪给定路由助手方法调用的URL可能会让人有点困惑。是否可以使用Ruby控制台查看给定的helper函数将生成什么链接?例如,给定一个像post_path(post)这样的命名助手,我想看看生成了什么URL。