简体   繁体   English

Rails 3路由性能问题

[英]rails 3 routing performance issue

i have added one route and one link and the load time for the page is now 5-6 seconds more. 我添加了一条路线和一条链接,页面的加载时间现在增加了5-6秒。

here is the routing: 这是路由:

  root :to => 'firstpage#index'

  resources :menus

  # this one is added
  match 'search' => 'search#index'

here is the link in the view: 这是视图中的链接:

<%= link_to "Sök", :controller => "search", :query => "ruby on rails" %>

i guess that rails is searching for the routing in the routing file, and that takes 5-6 secs more. 我猜想Rails在路由文件中搜索路由,这需要5到6秒的时间。 i think i have done the routing wrong or the link could be more appropriate constructed. 我认为我做的路由错误,或者链接可能更合适。

could you see any "fault" on this? 你能看到任何“故障”吗?

thanks! 谢谢!

5-6 seconds seems a little excessive for this to be the problem. 5-6秒似乎有点过分,这是问题所在。

you could try 你可以尝试

<%= link_to "Sök", search_path(:query => "ruby on rails")%>

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

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