手动路由还是FriendlyId?
我想完成一个如下所示的 URL 结构:
/comics
- 列出数据库中的所有漫画(实际上这可能是一个显示精选漫画、最受欢迎漫画等的门户页面)/comics/{comic-name}
- 列出给定漫画中的所有漫画(可能已分页)/comics/{comic-name}/feed
- 提供 RSS将条带送入漫画/comics/{comic-name}/{strip-id}
- 显示属于漫画的漫画片段
我应该使用FriendlyId 还是应该使用手动路由?无论您选择什么,请提供 paths.rb 片段。
谢谢!
I'd like to accomplish an URL structure which would look something like this:
/comics
- lists all the comics in the database (actually this could be a portal page showing featured comics, most popular comic, etc)/comics/{comic-name}
- lists all the strips in the given comic (possibly paged)/comics/{comic-name}/feed
- provides an RSS feed for the strips in the comic/comics/{comic-name}/{strip-id}
- shows a strip belonging to the comic
Should I go with FriendlyId or should I use manual routing? Whatever your pick please provide the routes.rb snippet.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将进行手动路由。使用FriendlyID,您可以轻松启动和使用,但是当您的应用程序开始变得复杂并且您开始自定义时,您最好开始不使用FriendlyID(取决于您必须执行的自定义深度)
I will go for manual routing. With friendlyID, you can get up and go easily but when your app starts becoming complex and you begin customizations, you might as well started without FriendlyID (depending on the depth of customizations you have to do)