Class: SlashAdmin::BatchActionsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- SlashAdmin::BatchActionsController
- Defined in:
- app/controllers/slash_admin/batch_actions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#delete ⇒ Object
5 6 7 8 |
# File 'app/controllers/slash_admin/batch_actions_controller.rb', line 5 def delete :destroy, model model.where(id: params[:ids]).delete_all end |
#model ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/controllers/slash_admin/batch_actions_controller.rb', line 10 def model ActiveRecord::Base.connection.tables.map do |klass| testing_class = klass.capitalize.singularize.camelize return testing_class.constantize if testing_class == params[:model_class].capitalize.singularize.camelize end raise Exception.new("Can't find model #{params[:model_class]}") end |