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 | |
parent | 4b83519e02d5d42708dd1770f965b122a11c4440 (diff) |
Redirects should be done with absolute urls
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/track_controller.rb | 2 | ||||
-rwxr-xr-x | app/helpers/link_to_helper.rb | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 0dec1fb72..dfa3a4834 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -279,7 +279,7 @@ class RequestController < ApplicationController else # if not requestable because defunct or not_apply, redirect to main page # (which doesn't link to the /new/ URL) - redirect_to public_body_path(@info_request.public_body) + redirect_to public_body_url(@info_request.public_body) end end return diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index df413b0ea..15da7f327 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -61,7 +61,7 @@ class TrackController < ApplicationController return atom_feed_internal if params[:feed] == 'feed' if self.track_set - redirect_to public_body_path(@public_body) + redirect_to public_body_url(@public_body) end end 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) |