-
-
Save rbeene/807c9a69eeeb278b8f95 to your computer and use it in GitHub Desktop.
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 Order do | |
# Export the current collection of items with filtering and sorting | |
# List the current collection ids | |
collection_action :export_txt do | |
render :text => collection.map { |order| order.id }.join(', ') | |
end | |
# Add a button to index page to export current collection as txt | |
action_item(:only => :index) do | |
link_to("Export TXT", export_txt_admin_orders_path(params.except("controller", "action"))) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment