Named routes _path vs _url

_path helpers provide a site-root-relative path. You should probably use this most of the time.

_url helpers provide an absolute path, including protocol and server name. I’ve found that I mainly use these in emails when creating links to the app on the server. They should mainly be used when providing links for external use. (Think email links, RSS, and things like the copy and paste URL field under a YouTube video’s “Share” section.)

Leave a Comment