Class: Admin::MailDeliveryStatusController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::MailDeliveryStatusController
- Defined in:
- app/controllers/admin/mail_delivery_status_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/controllers/admin/mail_delivery_status_controller.rb', line 23 def destroy @maildeliverystatus = MailDeliveryStatus.find(params[:id]) @maildeliverystatus.destroy redirect_to admin_mail_delivery_status_index_path, notice: t('.notice') rescue StandardError => e redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: e.) end |
#destroy_all ⇒ Object
16 17 18 19 20 21 |
# File 'app/controllers/admin/mail_delivery_status_controller.rb', line 16 def destroy_all @maildeliverystatus = MailDeliveryStatus.delete_all redirect_to admin_mail_delivery_status_index_path, notice: t('.notice') rescue StandardError => e redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: e.) end |
#index ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/admin/mail_delivery_status_controller.rb', line 4 def index @maildeliverystatus = MailDeliveryStatus.order(created_at: :desc) @maildeliverystatus = @maildeliverystatus.where(email: params[:email]) if params[:email].present? @maildeliverystatus = @maildeliverystatus.page(params[:page]).per(@per_page) end |
#show ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/admin/mail_delivery_status_controller.rb', line 10 def show @maildeliverystatus = MailDeliveryStatus.find(params[:id]) filename = "maildeliverystatus_#{params[:id]}.#{MIME::Types[@maildeliverystatus.].first.preferred_extension}" send_data(@maildeliverystatus., filename: filename, type: @maildeliverystatus.) end |