aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/link_to_helper.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-05 10:26:01 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-05 10:26:01 +0000
commit6a93d027e744bfc4ab2f8f7808ee99c770003481 (patch)
treeb8bfe4e93e2314c8c7c9b95e99a861d8fad6b05f /app/helpers/link_to_helper.rb
parent48bbe41b36402a22b808ec860c1a84673b74527f (diff)
parentb06195a428b5cb6c3e95b07c631e2f18febf05f0 (diff)
Merge branch 'release/0.5' into wdtk
Conflicts: .gitignore
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rwxr-xr-xapp/helpers/link_to_helper.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 54b8d69d0..5866c31f0 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -185,9 +185,16 @@ module LinkToHelper
end
- def main_url(relative_path)
+ def main_url(relative_path, append = nil)
url_prefix = "http://" + MySociety::Config.get("DOMAIN", '127.0.0.1:3000')
- return url_prefix + relative_path
+ url = url_prefix + relative_path
+ if !append.nil?
+ env = Rack::MockRequest.env_for(url)
+ req = Rack::Request.new(env)
+ req.path_info += append
+ url = req.url
+ end
+ return url
end
# Basic date format