aboutsummaryrefslogtreecommitdiffstats
path: root/lib/willpaginate_hack.rb
blob: 084329e82b7717def1959b2a5ea57e1fb172de17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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