Prefer url to PATH for url helpers

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the rails category.

Last Updated: 2024-11-02

When refactoring a route from dashboard_{path,url} to seller_dashboard_{path,url}, it was annoying to search for both possibilities path and url). Error-prone too.

Since there's not really any good reason to have both in my application, what with multiple domains and the need to use _url and not _path in emails, I should stick to url everywhere.

Update: Another complication to consider is multi-domain websites. While path can be easier for navigating within a domain, url is gonna be needed anyway for moving across domains (e.g. from the .com to the .co.uk site)