Sha256: 86cf109b77baf6d3fb619f0b4e5ba4d03e784a545357ce8c38ab20971cac66ca
Contents?: true
Size: 419 Bytes
Versions: 15
Compression:
Stored size: 419 Bytes
Contents
module Rack::App::InstanceMethods::RedirectTo def redirect_to(url, params={}) if params.empty? url = [url, request.env['QUERY_STRING']].join('?') unless request.env['QUERY_STRING'].empty? else query_string = Rack::App::Utils.encode_www_form(params.to_a) url = [url, query_string].join('?') end response.status = 301 response.headers['Location']= url finish! end end
Version data entries
15 entries across 15 versions & 1 rubygems