So one thing I had a WTF? with when I ran into it a few months ago was what routes do when a model name can’t be pluralized. For example, if you have a model named
series is both the singular and plural form of the word
series, so whereas you’d normally have path methods like
Series you get
If you try to use
series_path without an id, you just get an error about the missing argument, and it’s not clear that Rails has generated a
series_index_path - which is what you should be using to link to the index.
I’m not sure how realistic or performant it’d be to provide a hint here, but it might be nice to warn the user if it’s detected that they’re trying to access a path method in a specific way when the model isn’t pluralizable.
series_path(id: 1) wouldn’t trigger the hint, but
series_path with no arguments would cause Rails to print something like “You’re using
series_path without an id.
Series can’t be pluralized, maybe you meant