# File app/controllers/attendance_adm_controller.rb, line 40 def take # Do we have a timeslot we are working on? Or is there one (and # only one) currently active timeslot? If not, redirect the user # to choose it. unless @tslot = Timeslot.find_by_id(params[:id]) || Timeslot.single_current flash[:warning] << _('Please select a timeslot to take attendance for') redirect_to :action => 'choose_session' return false end # Results are received by this same controller, the form is shown # again ad nauseam if @person register_attendance(@person, @tslot) end @last_att = Attendance.find(:all, :limit => 5, :order => 'created_at DESC', :conditions => ['timeslot_id = ?', @tslot.id]) @attendance = Attendance.new end