Use Active Storage to render custom images

Just like we did with regular attachments, we're moving the logic to
generate URLs out of the model.

Note we're changing the `image_path_for` helper method in order to
return a `polymorphic_path` because sometimes it's used in combination
with `favicon_link_tag`, and `favicon_link_tag` doesn't automatically
generate a polymorphic URL when given an `ActiveStorage::Attachment`
record.
This commit is contained in:
Javi Martín
2021-07-27 22:51:28 +02:00
parent e0e35298d5
commit 8e6df7f5d9
5 changed files with 30 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB