Answer the question
In order to leave comments, you need to log in
How to generate CSV from cached data in ActiveAdmin?
There is a basic admin interface built with ActiveAdmin.
There is a list of some data (:name, :completed_at) whose values are in the Rails.cache for some key 'foo'.
You need to return a CSV file with a list from this array to the user in ActiveAdmin.
Added the following file
app/admin/status_reports.rb
ActiveAdmin.register StatusReport do
csv do
column :name
column :completed_at
end
end
class StatusReport < ApplicationRecord
attr_accessor :name, :completed_at
def initialize
end
end
but naturally swears by an errorPG::UndefinedTable: ERROR: relation "status_reports" does not exist.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question