I can currently make a request to my rails controller and I use send_file to download my production.log file. The file has gotten huge and I rarely need the entire file so I would like to download only part of the file like the last 20k lines. Is there a way to do this without reading the last n lines and writing those to another file and then sending that newly created file?
Here is the code I have at the moment:
def download_production_log
send_file("#{Rails.root}/log/production.log")
end