Skip to content

Instantly share code, notes, and snippets.

@rbeene
Forked from pcreux/order.rb
Created August 16, 2014 23:49
Show Gist options
  • Save rbeene/807c9a69eeeb278b8f95 to your computer and use it in GitHub Desktop.
Save rbeene/807c9a69eeeb278b8f95 to your computer and use it in GitHub Desktop.
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