Skip to content

Instantly share code, notes, and snippets.

@wilkerlucio
Created August 12, 2013 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wilkerlucio/6214088 to your computer and use it in GitHub Desktop.
Save wilkerlucio/6214088 to your computer and use it in GitHub Desktop.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8acc96c..ae5bbb0 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -122,8 +122,9 @@ class ApplicationController < ActionController::Base
end
def store_subdomain
- @store_domain ||= request.subdomain.blank? ?
- 'www' : request.subdomains.last
+ subdomain = request.subdomains.reject { |part| part =~ /^\d+$/ }
+ @store_domain ||= subdomain.blank? ?
+ 'www' : subdomain.last
end
def order_store(user)
diff --git a/config/settings/application.yml b/config/settings/application.yml
index f247353..6872afb 100644
--- a/config/settings/application.yml
+++ b/config/settings/application.yml
@@ -48,9 +48,9 @@ defaults: &defaults
development: &development
<<: *defaults
site:
- url: http://my.local
- domain: my.local
- old_domain: my.local
+ url: http://xip.io
+ domain: xip.io
+ old_domain: xip.io
enable_tracking_codes: false
test:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment