所以我希望我的应用程序生成诸如堆栈溢出之类的路由
questions/:id/:title
我怎样才能在 Rails 中做到这一点?
请注意:
http://stackoverflow.com/questions/4434266/stack-overflow-like-url-routes-in-rails-3
http://stackoverflow.com/questions/4434266/
http://stackoverflow.com/questions/4434266/you-can-put-wathever-you-want-here
是相同的。我想 stackoverflow 这样做只是为了提供一些上下文(如果您只看到那里的链接)。
所以,你的路线就是这样:
http://stackoverflow.com/questions/4434266/
这应该是这样的:
http://stackoverflow.com/questions/:id
您可以忽略网址的其余部分
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)