0

Does the resource name have to be plural ('resources :articles' ) When you define a resource inside the route.rb? If so, does the name of model need to be the same but in singular form so the model table will match the resources since rails will convert it to plural.

Or it doesnt really matter? I am so confused...

null
  • 1,062
  • 1
  • 9
  • 21
  • Possible duplicate of [Difference between resource and resources methods](https://stackoverflow.com/questions/9194767/difference-between-resource-and-resources-methods) – Md. Farhan Memon May 23 '17 at 06:27
  • I'm voting to close this question as off-topic because a simple Google search could answer this question. Or reading through the Rails docs. – vich May 23 '17 at 17:47

1 Answers1

0

Does the resource name have to be plural

Not always! You can declare singular resources as well. But the resource name should match the controller name not the model name. You should read Resource Routing to understand better

As per the convention, the model name should always be singular and Rails by default looks for plural form of the model name in the table.

Pavan
  • 33,316
  • 7
  • 50
  • 76