Commit 1477cefc by Ivan Lan

batch destroy

parent 799368cd
......@@ -57,6 +57,14 @@ class SimpleController::BaseController < ::InheritedResources::Base
render json: { url: url }, status: 201
end
def batch_destroy
collection.transaction do
params[:ids].each do |id|
collection.find(id).destroy!
end
end
end
protected
class << self
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment