Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Rails Routes and Resources A Route to an Index Action Creating a Model

Danish Saleem
Danish Saleem
7,965 Points

why creating the controller with plural names and creating model with singular ?

When we are creating the controller we use the plural form of the name , but when we are creating the model class we are using the singular form of the name , why ?

1 Answer

Umar Ghouse
Umar Ghouse
14,607 Points

Think of it like this. The model is like a blueprint for every instance of the model and the controller is what "controls" all the instances of that model.

For example, if we have a person model, then the model will serve as the blueprint for each person that we create. i.e. Using the model blueprint, we can create only one person at a time. Hence we use the singular form Person.

But the controller decides what happens to every person. Hence we use the plural form PeopleController.

I hope that helped! Let me know if you need any extra clarification :)