Guest User

Untitled

a guest
Nov 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. has_many :classroom_students
  2. has_many :students, through: :classroom_students
  3.  
  4. has_many :classroom_students
  5. has_many :classrooms, through: :classroom_students
  6.  
  7. def import
  8. @students = Student.all
  9. if params[:file].present?
  10. Student.import(params[:file], current_user.id)
  11. redirect_to students_path, notice: 'Students imported.'
  12. else
  13. redirect_to students_path, notice: "You need to choose a file first!"
  14. end
  15. end
Add Comment
Please, Sign In to add comment