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 trialAustin Gates
15,391 PointsWhy do certain things automatically happen?
We made the scaffold and specified name:string content:text
That being said, why is there automatically edit and delete buttons, why does the page automatically come up as "Statuses"? What defines all of this?
1 Answer
Justin Black
24,793 PointsIt's a programming design pattern. Where in, when creating the scaffold you are talking about what each individual item will contain. The class however, needs to be pluralized being that it can hold more than one item.
Rails is one of the few frameworks ( for any language ) that do this automatically. I actually prefer it, it forces you to stick with a proper design pattern which in turn often results in better code, that is easily maintained and easily scale-able in the future.
As for the edit and delete buttons, it isn't inconceivable that if you want to be able to create an item, that you'd like to be able to edit and delete them as well. Rails does this automatically specifically to save you time as a developer. And let me tell you, as a developer, the more time our tools save us the better.
Austin Gates
15,391 PointsAustin Gates
15,391 PointsAfter taking a few more lessons, it made sense. It's really awesome and I'm in love with Rails!
Justin Black
24,793 PointsJustin Black
24,793 PointsI feel you there. I've done PHP for 20 years, have known the basics of ruby for a few years but nothing substantial. Now, I definitely like it -- even getting ready to start converting all my mobile app api's over to it. Should be fun!