aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-02-27 12:04:10 +0000
committerfrancis <francis>2008-02-27 12:04:10 +0000
commitabc70d713ddbd2e337a0f419a268b964bed66832 (patch)
tree0364cb2a47d4f8b384f4fa1f225a4ac0051edd66 /app/controllers/user_controller.rb
parent6047f78479bb8951b8ce4caab8161767e4ef7646 (diff)
Store URL name in database.
Allow blank short names.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index baeffc7db..8dc056167 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -4,13 +4,13 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user_controller.rb,v 1.26 2008-02-20 12:51:29 francis Exp $
+# $Id: user_controller.rb,v 1.27 2008-02-27 12:04:10 francis Exp $
class UserController < ApplicationController
# XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below
def show
- if simplify_url_part(params[:simple_name]) != params[:simple_name]
- redirect_to :simple_name => simplify_url_part(params[:simple_name])
+ if MySociety::Format.simplify_url_part(params[:simple_name]) != params[:simple_name]
+ redirect_to :simple_name => MySociety::Format.simplify_url_part(params[:simple_name])
end
@display_users = User.find(:all, :conditions => [ "regexp_replace(replace(lower(name), ' ', '-'), '[^a-z0-9_-]', '', 'g') = ?", params[:simple_name] ], :order => "created_at desc")