In my local, I have written
<%= link_to 'App', "/App.apk", data: { no_turbolink: true } %>
It is working fine simply downloading App.apk file which is present in public folder
But on production, the same link gives the error
Not Found
The requested URL /App.apk/ was not found on this server.
Can anyone give me any idea why this is behaving differently on different environment
Thankyou in advance
Instead of adding path in direct link, create one action which download the file from public folder.
routes.rb
get 'download_apk'
in your controller add below action which downloads apk file
def download_apk
send_file("#{Rails.root}/public/App.apk")
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With