randym / activeadmin-axlsx

ActiveAdmin plugin using Axlsx for adding Excel (xlsx) download links for your resources
MIT License
82 stars 134 forks source link

index_without_xlsx(options) fails with wrong number of arguments (1 for 0) #47

Open jasper502 opened 8 years ago

jasper502 commented 8 years ago

lib/active_admin/axlsx/resource_controller_extension.rb

index_without_xlsx(options) fails with:

wrong number of arguments (1 for 0)

      def index_with_xlsx(options={}, &block)
        index_without_xlsx(options) do |format|
           format.xlsx do
            xlsx = active_admin_config.xlsx_builder.serialize(collection)
            send_data xlsx.to_stream.read, :filename => "#{xlsx_filename}", :type => Mime::Type.lookup_by_extension(:xlsx)
          end
        end

All my active admin index pages fail with the same error

Bastes commented 8 years ago

This is the same issue as #42 ; fortunately there seems to be a fix in a fork (haven't tried it myself yet but it looks great so far): https://github.com/ybart/activeadmin-axlsx/commit/cb090ada3f6fe079d7f36f3ac2cb09cebd2c001d