Ruby on Rails Monday, July 10, 2017

I'm going to try to answer my own question.

I tracked down this answer: code here.

The most important sentence tompave wrote in is this:

A model with a plural name, e.g. class Users, will confuse rails.


I was following along on

And one can find there
rails generate scaffold Articles title:string body:text

This generates a warning

[WARNING] The model name 'Articles' was recognized as a plural, using the singular 'Article' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.

The second most important sentence in tompave's answer is
Normally it would be user_path for singular routes (show, update, delete) and users_path for the plural ones (index, create). Here, however, users_path must be used for the singular routes, and Rails will fallback to use users_index_path for index and create.

The person who coded up the Rspec test seems to have known using the plural form "Articles" would generate the articles_index_path method rather than article_path.

And thus my confusion has been addressed.

I wish I could thank tompave directly


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment