There seems to be a small bug with has_one relationships and resource
in the routes.
Example:
where beta has_one alpha
In routes:
resource alpha
In view:
form_for @alpha --> automatic link is alpah_path(id) and not
alpha_path
and in this case since there is no id in the route, the id takes the
place of the format param -> /alpha.1
There have been a lot discussion about this a while ago. However, we couldn’t find the way to determine the correct route to use when you have a singular resource, so it was left unfixable.
I was thinking about the same thing too, but something was blocking me at that moment. Do you mind digging into the source code and see if it’s possible from your perspective, and then send a pull request if you can patch it?
That's certainly one of the solutions I've thought about and I've got a GitHub issue (#1769) assigned to me regarding this issue so it's on my todo list once 3.1 has shipped.