Skip to content

Instantly share code, notes, and snippets.

@mileszs
Forked from agibralter/gist:430807
Created October 1, 2010 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mileszs/606533 to your computer and use it in GitHub Desktop.
Save mileszs/606533 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment