Absolute URL for an ActiveStorage attachment
This blog post was originally published a little while ago. Please consider that it may no longer be relevant or even accurate.
Not sure why, but I couldn't get url_for
to give me an absolute URL with an ActiveStorage attachment, even when playing with all the options available. Turns out that polymorphic_url
will give you what you're after though.
A blog about Laravel & Rails by Dwight Watson;
- developer of Roomies, High School Notes & StudentVIP.
- previously myRent & Flatmates.
- also writing Minitest on Rails.