|
|
@ -17,7 +17,9 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
|
|
|
|
def destroy
|
|
|
|
def destroy
|
|
|
|
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
|
|
|
|
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
|
|
|
|
|
|
|
|
|
|
|
|
current_laboratory_subject.destroy!
|
|
|
|
current_subject = current_laboratory_subject.subject
|
|
|
|
|
|
|
|
current_subject.shixuns.destroy_all
|
|
|
|
|
|
|
|
current_subject.destroy!
|
|
|
|
|
|
|
|
|
|
|
|
render_delete_success
|
|
|
|
render_delete_success
|
|
|
|
end
|
|
|
|
end
|
|
|
|