Skip to content

Instantly share code, notes, and snippets.

@Bill Bill/gist:11679
Created Sep 19, 2008

Embed
What would you like to do?
# by Bill Burcham http://thoughtpropulsion.com
# do what you want with this
# Add :host variable extraction to Dan Webb's request_routing plugin
module Propel
module MultiDomainRouting
# include this module in RouteSet after request_routing plugin is loaded
module ExtractHostParameter
def self.included( other)
other.alias_method_chain :extract_request_environment, :host
# patch corresponding matcher
ActionController::Routing::Route::TESTABLE_REQUEST_METHODS << :host
end
def extract_request_environment_with_host( request )
extract_request_environment_without_host( request ).merge :host => request.host
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.