Using subdomain as account key in Ruby on Rails
attr_writer :account attr_reader :account before_filter { |c| c.account = Account.find_by_subdomain(c.request.subdomains.first) }
DZone Snippets > peter > subdomains
12388 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Peter Cooperx http://www.petercooper.co.uk/
attr_writer :account attr_reader :account before_filter { |c| c.account = Account.find_by_subdomain(c.request.subdomains.first) }