试题库的反选功能

video_transcode
cxt 5 years ago
parent 7fc81434a8
commit 03eda20745

@ -1,9 +1,9 @@
class ExaminationBanksController < ApplicationController
include PaginateHelper
before_action :require_login
before_action :certi_identity_auth, only: [:create, :edit, :update, :destroy, :set_public, :revoke_item]
before_action :find_exam, except: [:index, :create]
before_action :edit_auth, only: [:update, :destroy, :set_public, :revoke_item]
before_action :certi_identity_auth, only: [:create, :edit, :update, :destroy, :set_public, :revoke_item, :cancel_items]
before_action :find_exam, except: [:index, :create, :cancel_items]
before_action :edit_auth, only: [:update, :destroy, :set_public, :revoke_item, :cancel_items]
before_action :identity_auth, only: [:index]
def index
@ -76,6 +76,11 @@ class ExaminationBanksController < ApplicationController
render_ok
end
def cancel_items
current_user.item_baskets.where(item_bank_id: params[:item_ids]).destroy_all
render_ok
end
private
def form_params

@ -85,6 +85,7 @@ Rails.application.routes.draw do
post :set_public
delete :revoke_item
end
post :cancel_items, on: :collection
end
resources :examination_items do

Loading…
Cancel
Save