class LocationsController < ApplicationController
before_filter :find_location, :except => [:index]
def index
end
def show
end
def announcements
end
def find
@map = GMap.new("map_div")
@map.control_init(:large_map => true,:map_type => true)
@map.center_zoom_init([@location.lat,@location.lng],12)
@map.overlay_init(GMarker.new([@location.lat,@location.lng],:title => @location.name, :info_window => "JW Tumbles #{@location.name}
#{@location.address1}
#{@location.city} #{@location.state_province} #{@location.postal_code}
Get driving directions »"))
end
def schedule
@session = Session.find(params[:id]) rescue @location.sessions.current_session
end
def contact
end
def state
@locations = Location.find(:all, :conditions => ["state_province = ?", params[:id]])
end
def country
@locations = Location.find(:all, :conditions => ["country = ?", params[:id]])
end
private
def find_location
@location = Location.find_by_name(current_subdomain)
if @location.nil?
flash[:error] = "Blog invalid"
redirect_to 'http://jwt-public.local/'
end
end
end