w4d1 - Oh CRUD!
Today we officially began our quest to master Rails. It seems like a daunting task, but every journey starts with just one step. We spent the latter part of last week preparing for the journey, and it seems to have paid off thus far.
I thought today went pretty well and I’m beginning to understand Rails more and more each time I look at it. Today was all about setting up Routes and configuring controllers to handle those route requests. To do this we spent the day setting up a simple Contact Sharing API that was able to store a users contacts and then allowed the user to share those contacts with any other users. This project also introduced us to the concept of an API, which, from what I gather, is a very broadly used term. In this context, we were providing raw data (rendered as JSON objects) via specific routes that could be hooked into from a separate program. We learned that this is actually similar to the way that popular applications like Twitter and Tumblr handle API requests, which is what allows independent developers to build applications or web parts surrounding those elements.
We also learned about the importance of designing with CRUD in mind. Create, Read, Update, Destroy. If you can design your sites resources using just these actions, then you should be able to produce a RESTful, (REpresentational State Transfer) application, which is all the rage these days. That basically means that the application should work in such a way that doesn’t expose the inner workings of itself to the client. A person interacts with their browser, the browser interacts with a web server, and the server takes care of everything and lets the browser know how to proceed. This isn’t the olden days anymore (like pre 2000!)