Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created June 8, 2010 23:41

Revisions

  1. agibralter created this gist Jun 8, 2010.
    14 changes: 14 additions & 0 deletions gistfile1.builder
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    ActionController::Integration::Session.class_eval do
    def generic_url_rewriter
    env = {
    'REQUEST_METHOD' => "GET",
    'QUERY_STRING' => "",
    "REQUEST_URI" => "/",
    "HTTP_HOST" => host,
    "SERVER_PORT" => https? ? "443" : "80",
    "HTTPS" => https? ? "on" : "off",
    "rack.input" => "wtf"
    }
    ActionController::UrlRewriter.new(ActionController::Request.new(env), {})
    end
    end