Skip to content

Instantly share code, notes, and snippets.

@rduarte
Forked from anonymous/gist:44400
Created September 21, 2009 01:15
Show Gist options
  • Save rduarte/190009 to your computer and use it in GitHub Desktop.
Save rduarte/190009 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
before_filter :set_application
private
def set_current_account
@current_account = Account.find_by_subdomain(request.subdomains.first)
end
end
class CustomersController < ApplicationController
def index
@customers = @current_account.customers
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment