This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_filter :compress | |
def compress | |
if self.request.env['HTTP_ACCEPT_ENCODING'] and self.request.env['HTTP_ACCEPT_ENCODING'].match(/gzip/) | |
if self.response.headers["Content-Transfer-Encoding"] != 'binary' | |
begin | |
ostream = StringIO.new | |
gz = Zlib::GzipWriter.new(ostream) | |
gz.write(self.response.body) | |
self.response.body = ostream.string | |
self.response.headers['Content-Encoding'] = 'gzip' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WillPaginate | |
class RemoteLinkRenderer < LinkRenderer | |
def page_link(page, text, attributes = {}) | |
@template.link_to_remote( text, {:url => url_for(page), :method => :get}, attributes) | |
end | |
end | |
end |
NewerOlder