class ClassesController < ApplicationController before_filter :find_location def index @location = Location.find_by_name('Atlanta') @session = @location.sessions.first end def parent_participation @location = Location.find_by_name('Atlanta') @session = Session.current_session render :template => 'classes/index' end def show @program = Program.find_by_name(params[:class]) if !@location.blank? @programs = @program.schedules.find(:all, :conditions => ['session_id = ?', @location.sessions.first]) rescue nil end end private def find_location @location = Location.find_by_name(current_subdomain, :include => [:sessions]) end end