app/controllers/grades_controller.rb
# Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .
def grade_params
      student_id = params.require(:grade)[:student]
      if student_id
        student = Person.find(student_id)
      else
        student = nil
      end
      params.require(:grade).permit(:person_id, :assignment_id, :value).merge(:student => student)
    end
def grade_params student_id = params . require ( :grade ) [ :student ] if student_id student = Person . find ( student_id ) else student = nil end params . require ( :grade ) . permit ( :person_id , :assignment_id , :value ) . merge ( :student => student ) end
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .