Same thing I mentioned earlier. You're duplicating @student = Student.find(params[:student_id]).  Move that to a method.

See my comment on a previous branch.