Sha256: 66c63f65aa988a9a433ac2f86ea6bc52c5579c72e155e347a5807b2ca5263813

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

<%-
  # Based on Active Admin
  generator = RUBY_VERSION =~ /^1.8/ ? FasterCSV : CSV

  output = generator.generate do |csv|
    cols = @interface.attributes_for(:index)
    csv << cols.map{|col| col[:title]}
    @collection.each do |object|
      csv << cols.map do |col|
        if col[:data]
          instance_exec(object, &col[:data])
        else
          pretty_format(object.send(col[:attribute]))
        end
      end
    end
  end
%>
<%= output.html_safe %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_admin-0.7.1 app/views/simple_admin/admin/index.csv.erb