diff options
author | Francis Irving <francis@mysociety.org> | 2009-12-03 13:18:53 +0000 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2009-12-03 13:18:53 +0000 |
commit | 1053556b7c12d757f2e654266a855609658b2964 (patch) | |
tree | 6f258882491a6815bd97aec861e670236eb98681 /lib | |
parent | bcf0dc3226866264d1da4bcd208f4df69f9f02c8 (diff) |
Move WillPaginate hack into its own file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/willpaginate_hack.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/willpaginate_hack.rb b/lib/willpaginate_hack.rb new file mode 100644 index 000000000..084329e82 --- /dev/null +++ b/lib/willpaginate_hack.rb @@ -0,0 +1,14 @@ +# Monkeypatch! Hack for admin pages, when proxied via https on mySociety servers, they +# need a relative URL. +module WillPaginate + class LinkRenderer + def page_link(page, text, attributes = {}) + url = url_for(page) + if url.match(/^\/admin.*(\?.*)/) + url = $1 + end + @template.link_to text, url, attributes + end + end +end + |