never_had_a_name
never_had_a_name

Reputation: 93276

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.

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. i think i have done the routing wrong or the link could be more appropriate constructed.

could you see any "fault" on this?

thanks!

Upvotes: 0

Views: 227

Answers (1)

davydotcom
davydotcom

Reputation: 2210

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")%>

Upvotes: 1

Related Questions