Day 9: Pin Scaffolding and Learn Ruby the Hard Way
Today I added the functionality for users to create pins to my Rails app. I used a pretty straightforward $ rails generate scaffold command told Rails to skip using CSS stylesheets since I'm already using Twitter Bootstrap to style my site.
I'm starting to get a good handle on the MVC (model-view-controller) pattern used by Rails. Here's how I understand it.
The controller is akin to a manager. He processes information from the web browser, and figures out what to do with that information. Hence the name "controller". So let's say a viewer clicks "play" on a video. The browser sends that information to the controller, and the controller "routes" that info to the model. Think of the model as the back-end nerdy guy processing data requests. The model pulls the video from the database, and sends it back to the controller (manager). The controller then sends that information to View, which is what the user sees. Think of the View as the sales guy, who presents information to customers. Views don't know what's going on in the back-room (Model), they're just doing what the manager (Controller) tells them. Views generate the HTML, CSS and JavaScript necessary to display the requested information to the user, via the web browser.
We end up with:
Controller = Manager
Model = Back-Office Engineer
View = Sales Guy
Or even better represented visually:
Really cool stuff.
In other news, I completed 14 exercises in Zed Shaw's Learn Ruby the Hard Way. Zed's teaching style is "old school" in the sense that he drills you on the fundamentals and believe repetition is the mother of mastery. I prefer this to CodeAcademy or RubyMonk, because those services only go over a function once before moving on. I don't know about you, but there's now way I can be exposed to concepts like string interpolation and iterating over an array before learning them.
Oh, I almost forgot - I was accepted in Full Stack Academy's Road to Code Bootcamp! It's a free 2-day immersive bootcamp on HTML/CSS. They're holding it at Regent High School on the Upper East Side. I hope it will give me a solid foundation on these front-end languages. The founders had success giving 2-day coding bootcamps at MBA programs and decided to bring their craft to NYC.
Finally, a shout out to Jeffrey Zeldman for bringing on Avi Flombaum, dean of the Flatiron School, on the Big Web Show. It was great to hear Avi talk about the genesis of Flatiron, and his thoughts on scale in education are also interesting. If you'd like to know more, listen to the podcast here.














