Routing Standards
When creating a page for your Hub application, use the following standards for the urls.
Page | URL | Example Notes |
---|---|---|
List Resources | /{resources} | /products Resources is the plural name of the resource |
Action on Resources | /{resources}/{action} | /products/import Actions that do not relate to a single resources |
New Resource | /{resources}/new?{field=value} | /products/new?name=Example This is an example of the above case with a query string to prepopulate values. |
Individual Resource | /{resources}/{id} | /products/123 This should include the resource's edit form |
Individual Resource Action | /{resources}/{id}/{action} | /prodcuts/123/history Actions that relate to a single resource |
Many-to-Many Relationships | /{resourcesA}/{idA}/{resourcesB}/{idB} | /categories/123/products/123 Only for many-to-many use a single identifier if possible |
#
ErrorsWhen showing errors on pages, you should not redirect the user to another route, eg. /404
, but instead, display the error message on the requested URL.