如何向 Rails 中的每条路线添加内容?
鉴于我已经指定了相当多的资源并且不想将所有资源重构到命名空间中,是否有一种简单的方法可以将永久字符串添加到 Rails 应用程序中的每个 路由中?
我可以按照以下方式做一些事情
map.root 'myappnamehere'
并将该字符串附加到所有路线的开头吗? 我意识到这不是我通常实现map.root 的方式。
TIA
Is there an easy way to add a permanent string to every route in a Rails app, given that I already have quite a few resources specified and don't want to refactor all into a namespace?
Can I do something along the lines of
map.root 'myappnamehere'
and have that string appended to the beginning of all routes? I realise that this is not how I implement map.root normally.
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
path_prefix?
path_prefix?