Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

form for question ruby on rails

when i generate controller file i use rails generate controller user. but when i want to use form for, why do i need to put resources: users on routes.rb and why it has to be users instead of user, as i created user not users

thank you for your help, please help me to clarify this.

1 Answer

Chung Yau Jefferson Choi
Chung Yau Jefferson Choi
11,910 Points

We usually name the model as "User" in singular and name the controller as "users". Just a naming convention.

rails generate controller --help for more example.

thank you, now I see the reason behind it, so every time that i generate controller i have to generate name as plural, is it correct?