mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
added csv download
This commit is contained in:
parent
c7e92452af
commit
7f8eee52f4
41 changed files with 259 additions and 35 deletions
10
app/lib/csv_report_helper.rb
Normal file
10
app/lib/csv_report_helper.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
module CsvReportHelper
|
||||
def to_csv
|
||||
CSV.generate do |csv|
|
||||
csv << column_names
|
||||
all.each do |item|
|
||||
csv << item.attributes.values_at(*column_names)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue