diff options
author | francis <francis> | 2008-12-17 13:01:34 +0000 |
---|---|---|
committer | francis <francis> | 2008-12-17 13:01:34 +0000 |
commit | abba46f3cb56666dfbf756c3f3650075c743418f (patch) | |
tree | c1d92cbf3ae27f8b73d9d9a6af22105ab5f49b10 /app/helpers/link_to_helper.rb | |
parent | bfa80a7c2f5abba9378f50d9a641d0c175fdd59a (diff) |
Make all links in RSS feeds absolute, rather than relative, as readers don't
expand them.
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rw-r--r-- | app/helpers/link_to_helper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 16aa59117..4cba2b663 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.48 2008-11-07 00:47:23 francis Exp $ +# $Id: link_to_helper.rb,v 1.49 2008-12-17 13:01:35 francis Exp $ module LinkToHelper @@ -60,6 +60,9 @@ module LinkToHelper def public_body_link(public_body) link_to h(public_body.name), public_body_url(public_body) end + def public_body_link_absolute(public_body) # e.g. for in RSS + link_to h(public_body.name), main_url(public_body_url(public_body)) + end def public_body_admin_url(public_body) return admin_url('body/show/' + public_body.id.to_s) end @@ -77,6 +80,9 @@ module LinkToHelper def user_link(user) link_to h(user.name), user_url(user) end + def user_link_absolute(user) + link_to h(user.name), main_url(user_url(user)) + end def user_or_you_link(user) if @user && user == @user link_to h("you"), user_url(user) |