diff options
-rw-r--r-- | app/controllers/public_body_controller.rb | 6 | ||||
-rw-r--r-- | config/routes.rb | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 1ca82e463..5a591878f 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -93,5 +93,11 @@ class PublicBodyController < ApplicationController cache_in_squid end + + # Used so URLs like /local/islington work, for use e.g. writing to a local paper. + def list_redirect + @tag = params[:tag] + redirect_to list_public_bodies_url(:tag => @tag) + end end diff --git a/config/routes.rb b/config/routes.rb index 8cb25a15a..14df1c9f7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -65,6 +65,7 @@ ActionController::Routing::Routes.draw do |map| map.with_options :controller => 'public_body' do |body| body.list_public_bodies "/body", :action => 'list' body.list_public_bodies "/body/list/:tag", :action => 'list' + body.list_public_bodies_redirect "/local/:tag", :action => 'list_redirect' body.show_public_body "/body/:url_name", :action => 'show' body.view_public_body_email "/body/:url_name/view_email", :action => 'view_email' end |