Added attendances controller logic for index and show