Sha256: 0dcb1a8d1c6cd6a0e46708b63c9a5ab7c4c6e10d386b7294319f8580251d31f6
Contents?: true
Size: 411 Bytes
Versions: 31
Compression:
Stored size: 411 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::Utils.build_nested_query(params) url = [url, query_string].join('?') end response.status = 301 response.headers['Location']= url finish! end end
Version data entries
31 entries across 31 versions & 2 rubygems