diff options
author | francis <francis> | 2007-11-06 16:05:29 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-06 16:05:29 +0000 |
commit | b8690d35a212192cb18a1fe5d25d75d860a5942e (patch) | |
tree | b5485a83e4b8beb743c7f1806b90ebe157269469 | |
parent | f33e959eb553b311846dd6e8fd4559598e852756 (diff) |
Oops - String.foo! type commands are more aggressive than I thought in altering the existing string. It works through references too.
-rw-r--r-- | app/helpers/link_to_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index b621916b7..24ee8e578 100644 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: link_to_helper.rb,v 1.1 2007-11-01 05:35:43 francis Exp $ +# $Id: link_to_helper.rb,v 1.2 2007-11-06 16:05:29 francis Exp $ module LinkToHelper @@ -36,7 +36,7 @@ module LinkToHelper # XXX See controllers/user_controller.rb controllers/body_controller.rb for inverse # XXX consolidate somehow with stuff in helpers/application_helper.rb def simplify_url_part(text) - text.downcase! + text = text.downcase # this also clones the string, if we use downcase! we modify the original text.gsub!(/ /, "-") text.gsub!(/[^a-z0-9_-]/, "") text |