Last active
August 30, 2018 12:54
-
-
Save lcguida/c2db46414c080656d923ab6646de61a8 to your computer and use it in GitHub Desktop.
Exemplo de batch action ActiveAdmin (Grupo Rails - Facebook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register MyModel do | |
# .. | |
# Configura essa página do active admin para utilizar batch actions | |
config.batch_actions = true | |
# Remove a action destory em batch (Você pode controlar outras coisas por aqui) | |
batch_action :destroy, false | |
# Cria a action export | |
batch_action :export do |ids| | |
file = ZipExporter.generate_file(ids: ids) | |
send_data(file, filename: "export.zip", type: 'application/zip') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment