The routes issued by the rail helper resources can be divided into two groups:
Direct actions (the request with which is meaningful from the point of view of HTTP semantics):
- index: GET collections
- create: POST resource
- show: GET resource
- update: PATCH resource (or PUT, although the correctness of the Rails semantics is questionable here)
- destroy: resource delete
... and auxiliary stubs, which are needed solely because "you need to tell the browser how to perform the action":
- new: interface to create
- edit: interface to update
Direct actions simply use the path to what the action is being performed on, and the action itself is recognized from the HTTP method.
But there are no meaningful HTTP methods for stubs , so they use "with a tail" paths. And since the helper returns only the path (but not the method!), For direct actions, the path can be collected directly from their resource object , and for stubs, a helper or an object with a "hint" is needed.
Since the form of “hints” in the routing system is little known and has a very obscure syntax, it is often avoided in favor of helpers, but this is a matter of style.