when name spacing models. should the containing folder’s name be in plural form?
i.e. models/users/comment.rb or models/user/comment.rb?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It has to exactly match the namespace, so making the namespace singular means a singular for the folder.
I use singular, and I think that’s common. After all, the path to the model is about one model, not the collection. Plural is used in Rails for a collection, like an array variable or a database table name. Controllers use plural, I think because of the REST convention. Everything else is singular.