Sha256: d766d8402c677096b5f346e5c82aaf009989ec394202dcf7d43268f981dfe005
Contents?: true
Size: 638 Bytes
Versions: 40
Compression:
Stored size: 638 Bytes
Contents
module Rao module Api module ResourcesController::DestroyAllActionConcern extend ActiveSupport::Concern included do if respond_to?(:before_action) before_action :load_and_destroy_collection, only: [:destroy_all] else before_filter :load_and_destroy_collection, only: [:destroy_all] end end def destroy_all respond_to do |format| format.json { render json: serialize_collection(@collection) } end end private def load_and_destroy_collection @collection = resource_class.destroy_all end end end end
Version data entries
40 entries across 40 versions & 1 rubygems