I added an extra plug to serve uploaded images which I store in a custom folder and serve from a custom URI path /media
:
plug Plug.Static,
at: "/media",
from: {:my_app, "priv/uploads"},
gzip: false
plug Plug.Static,
at: "/",
from: :my_app,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
But to serve these files from web pages I now have to prepend media
to the URL like so:
<%= img_tag "/media" <> input_value(f, :media) %>
Is there a better way to achieve that?