diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-02-13 17:05:39 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-02-15 12:22:23 +1100 |
commit | 85223bb2b630c8576352816b47b3c93f5c0b593b (patch) | |
tree | 053b2f5503873770ca321991cced5834d62fe145 /app/helpers/link_to_helper.rb | |
parent | 4b83519e02d5d42708dd1770f965b122a11c4440 (diff) |
Redirects should be done with absolute urls
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rwxr-xr-x | app/helpers/link_to_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 0c0128182..4f749d9d3 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -79,8 +79,12 @@ module LinkToHelper end # Public bodies + def public_body_url(public_body, options = {}) + public_body.url_name.nil? ? '' : show_public_body_url(options.merge(:url_name => public_body.url_name)) + end + def public_body_path(public_body) - public_body.url_name.nil? ? '' : show_public_body_url(:url_name => public_body.url_name, :only_path => true) + public_body_url(public_body, :only_path => true) end def public_body_link_short(public_body) |