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

Is "status" a built-in type of scaffold in Rails, or arbitrary?

I'm in the early stages of the Treebook project, and I'm confused about the "statuses" scaffold. Is this basically like a template for a "status" mechanism that comes with the framework? Or is it an arbitrary name that we can use whatever we want for. If it's a type of scaffold, where can I find a list of other types?

3 Answers

A scaffold creates the controller, model and test files with basic actions (new, create, edit, update, destroy, show, index) all done for you. Depending on what you are trying to model, it may be faster to just use a scaffold.

Other times you want to have specific actions in your controller, in which case you could create the model and controller separately and they will be empty waiting for you to add them.

I can only answer part of your question but statuses is arbitrary. The statuses in the code was naming the files. I'm not sure though about where to find more types. Most things I've seen are made through a series of scaffolds and relationships. But I'm also not a ruby expert so take what I say with a grain of salt.

Thanks! What threw me off was that the directory name was pluralized "satuses." I figured that was too complicated of a naming scheme to be automatic, but apparently I spoke too soon. So if I'm understanding correctly, a scaffold can be called whatever I want, and it can function differently based on the variables I store in it?

Well it's more based on the relation to the database it has.