aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/public_body_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r--app/controllers/public_body_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index b668cb576..c1b39e063 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: public_body_controller.rb,v 1.1 2009-06-22 12:54:44 francis Exp $
+# $Id: public_body_controller.rb,v 1.2 2009-07-01 18:16:33 francis Exp $
class PublicBodyController < ApplicationController
# XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL
@@ -23,6 +23,13 @@ class PublicBodyController < ApplicationController
set_last_body(@public_body)
+ top_url = main_url("/")
+ @searched_to_send_request = false
+ referrer = request.env['HTTP_REFERER']
+ if !referrer.nil? && referrer.match(%r{^#{top_url}search/.*/bodies$})
+ @searched_to_send_request = true
+ end
+
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
begin