Method: Integral::Backend::BaseController#destroy

Defined in:
app/controllers/integral/backend/base_controller.rb

#destroyObject

DELETE /:id



87
88
89
90
91
92
93
94
95
96
# File 'app/controllers/integral/backend/base_controller.rb', line 87

def destroy
  if @resource.destroy
    respond_successfully(notification_message('delete_success'), send("backend_#{controller_name}_path"))
  else
    error_message = @resource.errors.full_messages.to_sentence
    flash[:error] = "#{notification_message('delete_failure')} - #{error_message}"

    redirect_to send("backend_#{controller_name}_path")
  end
end