aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application.rb
diff options
context:
space:
mode:
authorfrancis <francis>2007-10-30 18:52:26 +0000
committerfrancis <francis>2007-10-30 18:52:26 +0000
commit46b93b6f2aa7dd0f3c39f5bfbd86ba1c67022a98 (patch)
tree8079ce08bab8b2029c0480ea5166940c359b938b /app/controllers/application.rb
parent326c8c3b26ce95fb60cc3c519e00e1b178fada50 (diff)
Search history of public body short names in URLs and redirect from that.
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r--app/controllers/application.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index 0241ec66e..2affefa96 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: application.rb,v 1.16 2007-10-24 11:39:37 francis Exp $
+# $Id: application.rb,v 1.17 2007-10-30 18:52:27 francis Exp $
class ApplicationController < ActionController::Base
@@ -138,6 +138,18 @@ class ApplicationController < ActionController::Base
return request.env["REMOTE_USER"]
end
end
+
+ # Simplified links to our objects
+ # XXX See controllers/user_controller.rb controllers/body_controller.rb for inverse
+ # XXX consolidate somehow with stuff in helpers/application_helper.rb
+ # use :helper_method => :your_method_name
+ def simplify_url_part(text)
+ text.downcase!
+ text.gsub!(/ /, "-")
+ text.gsub!(/[^a-z0-9_-]/, "")
+ text
+ end
+
end