violet_rails
violet_rails copied to clipboard
RCA: Image/video not being rendered of api-resource in Heroku
The image/video file are not being rendered in heroku.

In the image above, we can see that url for the image (http://public.herokuapp.com/rails/active_storage/blobs/redirect...) is invalid. The domain is incorrect in the url.
For heroku, we have the url: violetrails.herokuapp.com. This is without the subdomain in the url. Generally, the domain length is 1 but for heroku, it is 2. Below is a code snippet run in heroku's rails console.

For the root domain in heroku, the url will work if we change it from http://public.herokuapp.com to http://violetrails.herokuapp.com/.
https://user-images.githubusercontent.com/25191509/186481776-80cb48de-0ccd-4976-878f-7ad10c378fa8.mp4
P.S. If we use the url: http://public.violetrails.herokuapp.com/, it will not work with the subdomain detail. This issue is yet to be figured out.