Sha256: 4ce2423624810955eb043c8d466ddaa9f00b4a6344e2df476fb0db7f6bed4b4a

Contents?: true

Size: 596 Bytes

Versions: 3

Compression:

Stored size: 596 Bytes

Contents

<%-
  csv_lib = if RUBY_VERSION =~ /^1.8/
              require 'fastercsv'
              FasterCSV
            else
              require 'csv'
              CSV
            end

  csv_output = csv_lib.generate(:col_sep => active_admin_config.csv_builder.column_separator || active_admin_application.csv_column_separator) do |csv|
    columns = active_admin_config.csv_builder.columns
    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 %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activeadmin-0.5.0 app/views/active_admin/resource/index.csv.erb
activeadmin-0.5.0.pre1 app/views/active_admin/resource/index.csv.erb
activeadmin-0.5.0.pre app/views/active_admin/resource/index.csv.erb