Rails 3 Engines:如何更改路线的优先级
我正在努力将我的一个应用程序的一些功能提取到引擎中。 看起来您的应用程序中的路由是生成的,然后是引擎的路由。最终结果是我的引擎路由被认为是低优先级,并且我的应用程序路由在到达引擎路由之前就耗尽了所有请求。我有办法控制引擎路线的优先级吗?
I am working on extracting some of the functionality of one of my apps into an Engine.
It seems that the routes in your app are generated and then the routes for the engine. The end result is that my engine routes are considered low priority and my app routes are eating up all the requests before they ever get to the engine routes. Is there way for me to control the priority of my engine routes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这个讨论:
http://groups.google.com/group/blacklight-development/browse_thread /thread/a22ee4636a70b485
过去是相反的。
您也许可以通过深入研究他们修复问题时所做的更改来找出如何扭转它。
具体来说,这个有一个 hack,通过加载 Routing::RouteSet 类内部的类来使用应用程序路由覆盖插件路由
http://robots.thoughtbot.com/post /159805560/tips-for-writing-your-own-rails-engine
显然这是较旧的 Rails - 但我认为您可能会根据自己的需求获得一些灵感:)
According to this discussion:
http://groups.google.com/group/blacklight-development/browse_thread/thread/a22ee4636a70b485
it used to be the other way around.
You might be able to figure out how to reverse it by digging into what changes they made when they fixed it.
Specifically this one has a hack that overrode plugin routes with app routes by loading the class inside of the Routing::RouteSet class
http://robots.thoughtbot.com/post/159805560/tips-for-writing-your-own-rails-engine
Obviously it's older rails - but I figured you might get some inspiration for your own needs :)