# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base helper :all before_filter :get_locations def subdomain render :text => current_subdomain end private def get_locations @locations_us = Location.find(:all, :select => 'DISTINCT state_province', :conditions => ["country = 'United States'"]) @locations_intl = Location.find(:all, :select => 'DISTINCT country') unless current_subdomain.blank? @location = Location.find_by_name(current_subdomain) end end end