<%- require 'csv' default = active_admin_application.csv_options options = default.merge active_admin_config.csv_builder.options columns = active_admin_config.csv_builder.columns csv_output = CSV.generate(options) do |csv| csv << columns.map(&:name) collection.each do |resource| csv << columns.map do |column| call_method_or_proc_on resource, column.data end end end %> <%= csv_output.html_safe %>