I'll give my overview of "Ruby on Rails" then list off resources for beginners.
Caution: I'm a student, like anyone else, so do not take my notes as the Gospel.
Overview of Ruby on Rails
So the three languages of the internet are: Ruby, Python, and JavaScript. But if you know Ruby on Rails, you will always have a job.
Ruby on Rails is peculiar to get started with (well, for me anyways). What's the basic idea?
Most people end up introducing Rails with some jargon about "MVC" (Model-View-Controller), Don't Repeat Yourself, Convention over Configuration...and from those three slogans alone, you should be able to program Rails applications.
Unfortunately, I am not that smart. So these are some notes to myself as far as what some of these slogans mean!
Imagine a car. People are concerned about how it looks, what color it is, etc. (the "View"). Others are concerned with what's going on under the hood (the "model"), and others worry about how the driver interfaces with the car and the car responds (the "controller").
For us, the Model usually is the data structures used. This is some flavor of ActiveRecord
(the API is available online [rubyonrails.org] for the "Base" class).
Great, now what's an "Active Record" and why should anyone give a damn? It's a way of describing the Object-relation mapping (ORM), i.e., encode a SQL database inside a Ruby object. For more about this, see Active Record [rubyonrails.org] for more details.
Lets be clear about this: the model is specified by active records. That's why we care. Got it? Good.
The view is much easier to understand: it's just a chunk of html. That's what the user views.
The controller is more-or-less taken care of, all thanks to the rails library. This is my understanding, at least. I may be completely wrong...
Resources
Several Screencasts [rubonrails.org] are available, and they are quite decent introductions!
You should first Try Ruby before doing rails; since rails is a ruby library...
The best walkthrough describing rails appears in a mere ten step program [tutsplus.com], and I must agree this is the best approach.
I found this YouTube Video (showing how to make a blog under ten minutes) quite enlightening, perhaps you might like it as well?
1 comment:
Nice post. I’ve been using Ruby, but need to start using Rails. This will help for me.
Post a Comment