Adding calculated fields to Ecto Schema - virtual field or?

I completely misread what you’re wanting to do - that is not, indeed, useful for creating routes for use inside the app instead for providing the final link outside of it (spa, wtv). Isn’t there a helper to build urls already?

Regarding the virtual field, it was just an example, sometimes it makes sense other times not?