Skip to content

Instantly share code, notes, and snippets.

@swindsor
Created August 16, 2010 23:50
Show Gist options
  • Save swindsor/527996 to your computer and use it in GitHub Desktop.
Save swindsor/527996 to your computer and use it in GitHub Desktop.
require 'action_controller/request'
DEFAULT_TLD_LENGTH = 2
module ActionController
class Request < Rack::Request
def domain_with_default(tld_length = DEFAULT_TLD_LENGTH)
domain_without_default(tld_length)
end
alias_method_chain :domain, :default
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment