Module: Railings::Domains
- Defined in:
- lib/railings/domains.rb
Defined Under Namespace
Classes: Subdomain
Class Method Summary collapse
Class Method Details
.const_missing(name) ⇒ Object
20 21 22 |
# File 'lib/railings/domains.rb', line 20 def const_missing name save name, Subdomain.new(name) end |
.save(name, subdomain) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/railings/domains.rb', line 24 def save name, subdomain const_set(name, subdomain).tap do ApplicationController.send :helper, Module.new do define_method "url_for_#{name.downcase}" do || unless subdomain == request.subdomain [:host] = with_subdomain subdomain [:only_path] = false end end end end end |