class SchedulesController < ApplicationController
  # POST /sessions
  # POST /sessions.xml
  def create
    @session = Session.find(params[:session_id])
    @schedule = @session.schedules.new(params[:schedule])
    respond_to do |format|
      if @schedule.save
        flash[:notice] = 'Schedule was successfully created.'
        format.html { redirect_to location_session_path(params[:location_id], @session.id) }
        format.xml  { render :xml => @session, :status => :created, :location => @session }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @session.errors, :status => :unprocessable_entity }
      end
    end
  end
end