9
10
11
12
13
14
15
16
17
18
|
# File 'lib/active_admin/async_export/resource_controller_extension.rb', line 9
def index_with_email(options={}, &block)
index_without_email(options) do |format|
format.email do
current_user_method = active_admin_config.namespace.application.current_user_method
admin_email = send(current_user_method).email
ActiveAdmin::AsyncExport::AsyncExportMailer.delay.csv_export(admin_email, collection.first.class.to_s)
redirect_to :back, notice: "CSV export emailed to #{admin_email}!"
end
end
end
|