开发者

rails 3 routing performance issue

开发者 https://www.devze.com 2023-01-08 13:33 出处:网络
i have added one route and one link and the load time for the page is now 5-6 seconds more. here is the routing:

i have added one route and one link and the load time for the page is now 5-6 seconds more.

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 fo开发者_高级运维r the routing in the routing file, and that takes 5-6 secs more. 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.

you could try

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

精彩评论

暂无评论...
验证码 换一张
取 消