Learning RoR – Databases…
I’m about to start Chapter 8 – Validating and Testing RoR apps. Just finished the basics of managing Databases, which is a bit different from what I’m used to do in ASPX or Java with a Backend….gotta change the way I think of connecting to a database, which is: Creating stored procedures to insert or extract data, some other SP’s to update data or using Linq to generate queries to the DB.
When talking about managing data in databases things are really different in RoR. RoR generates everything for you, so far I haven’t written a SINGLE query (besides the create table queries)….I kinda miss writing queries
. But still, is cool how RoR takes care of it. Although there are a couple of constraints here, for e.g. naming convention in your models (this are the ones manipulating the data).
Also, this is just my second real experience with MVC (previous one was with SAP Java WebDynpro, which I didn’t like that much). I’ve read a lot about it and how it works and everything else, but I’m not an expert in this matter….afterwards, I’ll definitely have to go back to Chapter 7 (Working with Databases) and review it and practice till I really understand fully how MVC works in RoR.
So far, this is what I’ve understand:
Views -> Anything you want to display goes here (this is obvious).
Models -> Interaction with the DB and Ruby classes.
Controllers -> Manages data and actions between Views and Models.
Still liking a lot the simplicity and functionalities of RoR, but in order to fully understand everything, I’ve got to change my way of thinking while programming in RoR. This has become my priority #1 in “Learning RoR”.



Leave a Reply