aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/general_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-09-16 09:26:34 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-09-16 12:09:35 +0100
commitc13c5a717ad2ede8f51cc90c66daf8f573bf2ea4 (patch)
tree1c447e0dfdcde4da12251fd07786b937df4367fe /app/controllers/general_controller.rb
parent71827c431a1a931c3e308f573b681f9dbd240483 (diff)
Preserve search text when flipping between result types. Fixes #187.
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r--app/controllers/general_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index cefc3c020..55abea3b7 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -125,7 +125,7 @@ class GeneralController < ApplicationController
return
end
[:latest_status, :request_variety, :request_date_after, :request_date_before, :query, :tags].each do |x|
- params[x] = session[x]
+ params[x] = session[x] if params[x].nil?
end
combined = params[:combined]
@sortby = nil
@@ -160,14 +160,17 @@ class GeneralController < ApplicationController
@bodies = false
@requests = false
@users = true
+ else
+ @variety_postfix = "all"
end
- else
- @variety_postfix = "all"
end
@query = combined.join("/")
if params[:query].nil?
params[:query] = @query
end
+ if @variety_postfix != "all" && @requests
+ @query, _ = make_query_from_params
+ end
@inputted_sortby = @sortby
@common_query = get_tags_from_params
if @sortby.nil?