diff --git a/app/controllers/public/profile_search_controller.rb b/app/controllers/public/profile_search_controller.rb index 32b7fec..af2a78c 100644 --- a/app/controllers/public/profile_search_controller.rb +++ b/app/controllers/public/profile_search_controller.rb @@ -9,7 +9,10 @@ class ProfileSearchController < PublicController @q = params[:q] unless @q.blank? if params[:where] == 'environment' - redirect_to :controller => 'search', :query => @q + # user is using global search, redirects to the search controller with + # the query + search_path = url_for(:controller => 'search', :query => @q) + request.xhr? ? render(:js => "window.location.href = #{search_path.to_json}") : redirect_to(search_path) else @results = find_by_contents(:articles, profile, profile.articles.published, @q, {:per_page => 10, :page => params[:page]})[:results] end -- libgit2 0.21.2