问题
I was downloading a csv of a model using active admin 0.3.4 that had around 12,000 records. But the csv was limited to only 10,000 rows of data. Is there a way to not limit the number of rows in the csv download?
回答1:
There was a function called max_csv_records in lib/active_admin/resource_controller/collection.rb of the github source code.. Change the default constant to how much ever you need
回答2:
It's hardcoded
I put this in my config/intializers/active_admin.rb
# Monkey patch to increase the number of records
# exported in csv download -default is 10k
module ActiveAdmin
class ResourceController
module DataAccess
# in active admin 0.6
def max_csv_records
30_000
end
# needed for current active admin master
def max_per_page
30_000
end
end
end
end
来源:https://stackoverflow.com/questions/9355126/active-admin-in-rails-csv-limit