Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- has_many :classroom_students
- has_many :students, through: :classroom_students
- has_many :classroom_students
- has_many :classrooms, through: :classroom_students
- def import
- @students = Student.all
- if params[:file].present?
- Student.import(params[:file], current_user.id)
- redirect_to students_path, notice: 'Students imported.'
- else
- redirect_to students_path, notice: "You need to choose a file first!"
- end
- end
Add Comment
Please, Sign In to add comment