I have a page that lists records based on the parameters given in the search filter. I need to give a download link, wherein the current records on the page are written to a file and given as a link to be downloaded.
So to put it simple, how do I give the latest records found based on the search parameters as a download link ?
P.S : I’m using the send_file method.
You could link to the download action using a custom :format merged with the query params. Something like this:
Not the cleanest example but hopefully you get the idea.