简体   繁体   English

Rails路线太多?

[英]Too Many Rails Routes?

I'm working on a Rails application right now and the site currently has about 30 routes(map.connect). 我现在正在使用Rails应用程序,该站点当前大约有30条路线(map.connect)。 I expect that to eventually reach about 60 or 70. Is there any side effect of having lots of routes? 我希望最终能达到60或70。有很多路线会有副作用吗? I guess I'm just paranoid! 我想我只是偏执! :) Thanks :) 谢谢

Re: 70 routes a problem? 回复:70条路线有问题吗?

No, it works fine. 不,可以正常工作。 My Rails project has about 1000 and it works fine. 我的Rails项目大约有1000个,并且运行良好。

(It has that many because a scaffold that I use, Hobo, is automatically creating them) (之所以这么多,是因为我使用的脚手架Hobo正在自动创建它们)

660 in my non-scaffold application. 660在我的非脚手架应用程序中。 Only problem is rake routes takes a tick to load. 唯一的问题是rake routes需要打勾才能加载。

否,但是我建议您查阅该指南,以防万一您错过了什么: http : //guides.rubyonrails.org/routing.html

See @stephenmurdoch's answer here: Rails routes and site performance 在此处查看@stephenmurdoch的答案: Rails路线和站点性能

70 may not affect performance, but too many routes may. 70可能不会影响性能,但可能会有太多路线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM