rails/rails — pull request #15725 by sgrif (2014-06-14 13:27:00+00:00)
Title: Use singular routes when plural routes do not exist

We have two distinct problems here. For new records, it's much simpler -- The detected index route will not exist, so we can simply check `respond_to`.

With show actions, the detected helper method will exist, but take one fewer argument than we think. The method itself is splatting args, so it's difficult to make a determination based on the arity of the function. It seems the simplest thing to do here is check if a model was passed as the format argument.

Fixes #1769