Method / Process to export active record data to excel file, save xls file on S3 and provide download xls feature

In one of our web application, we had a specific requirement wherein the client wanted the data from the app into a specific xls format. Thus we needed to export data from our app in this custom format and save the xls file on S3. Our app will then show a link to "Download" in ActiveAdmin UI clicking which it will start downloading this xls file from S3 on clients local PC. We have broken down the process into numerous steps, hope this will be helpful. The process goes as follows: The data from the app is exported