1
등록 컨트롤러의 업데이트 작업에이 코드가 있습니다. 그리고 정의되지 않은 메소드 'errors'
을 얻습니다. 여기에 플래시 메시지를 사용할 수 없습니다.정의되지 않은 메소드`errors '
if subjects_selected.blank?
@registration = Registration.where(:student_id => params[:registration][:student_id], :semester_id => params[:registration][:semester_id])
redirect_to editreg_registrations_path(@registration.first.id, params[:registration][:student_id], params[:registration][:semester_id]), @registration.errors.add(:You_have_to_register_for_at_least_one_subject) and return
end
어떻게 오류 방법에 액세스 할 수 있습니까?
당신이 당신의 전체 오류 스택을 게시 할 수 등록 모델에
같은 오류를 표시 오류에 대한 등록 모델의 방법을 취할 수 있습니다.? – Pavan