是否可以使用“前端控制器”? 在 Rails 中?
在 Spring MVC 中,Dispatcher servlet 用作“前端控制器”来处理所有应用程序请求并适当地路由它们。
是否可以在 Rails 中使用这种方法,或者是否需要为每种类型的操作编写单独的控制器,而无需“交通警察”(前端控制器)指导流程?
In Spring MVC a Dispatcher servlet is used as a "front controller" to handle all of the application requests and route them appropriately.
Is it possible to use such an approach in Rails or is it required to write a separate controller for each type of action without having a "traffic cop" (front controller) directing the flow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查一下包罗万象的路线上的铁轨,我认为这就是您所追求的:
http://railscasts.com/episodes/46-catch-all-route
checkout the rails cast on catchall routes, I think this is what you are after:
http://railscasts.com/episodes/46-catch-all-route
如果您想要对路由进行更细粒度的控制,也许 Merb 更适合您。
Maybe Merb is more what you're after if you want more fine grained control over routing.