aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-09-03 17:35:44 +0100
committerFrancis Irving <francis@mysociety.org>2010-09-03 17:35:44 +0100
commitd62de2e81fed40f08ba3face75ac41cf4f57a835 (patch)
treebd1031cca3aa04b67d0b728249823bf5bd4d5adb /app/controllers/application_controller.rb
parentec1ba0e3f5bc5c26aa5769a959f061857973b08d (diff)
Reorganise list page structure
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 959caf7ef..41108ad19 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -251,12 +251,15 @@ class ApplicationController < ActionController::Base
# Peform the search
@per_page = per_page
if this_page.nil?
- @page = (params[:page] || "1").to_i
+ @page = get_search_page_from_params
else
@page = this_page
end
return InfoRequest.full_search(models, @query, order, ascending, collapse, @per_page, @page)
end
+ def get_search_page_from_params
+ return (params[:page] || "1").to_i
+ end
# Store last visited pages, for contact form
def set_last_request(info_request)