Class: EasyAdmin::DeleteAction

Inherits:
Action
  • Object
show all
Defined in:
lib/easy_admin/delete_action.rb

Constant Summary

Constants inherited from Action

Action::BATCH, Action::INSTANT, Action::MODAL, Action::SINGLE

Instance Attribute Summary

Attributes inherited from Action

#params

Instance Method Summary collapse

Methods inherited from Action

field_config, form_field, #form_param, #initialize, instant, instant?, modal, modal?, #permitted?, #turbo_response_strategy, #visible?

Constructor Details

This class inherits a constructor from EasyAdmin::Action

Instance Method Details

#performObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/easy_admin/delete_action.rb', line 11

def perform
  # Delete the record
  record.destroy!
  
  {
    success: true,
    message: "Record deleted successfully",
    strategy: :remove # Remove the row from the table
  }
end