Ruby on Rails: The Beginning

Share This Post

As a programmer new to Ruby who has recently debunked the command line tools issue when starting with Ruby on a Mac you are now ready to begin in earnest your Ruby on Rails or RoR (you know how us Geeks love our acronyms) coding career.
The MVC programming pattern is used in Ruby on Rails and it can be a little confusing if you are new to programming in general or a veteran coder. The acronym M-V-C stands for Model-View-Controller and each has a specific function for your web application.

  • Model – Contains application data, logic, rules, functions
  • View – The visual representation of said data, rules, logic, etc.
  • Controller – Mediator between the Model and View

Ruby chart
If that seems a bit abstract to you let’s think of it in another way.  View – it’s your eyes. You see what is going on. What do you do with those visual elements? You pass them along your Controller / central nervous system until they get to your Model / brain.
So let’s say that your View is a large, angry looking ferret staring you down with its dark, beady eyes. After your controller has sent that data to your Model it will most likely tell you do adjust your view by turning and moving in a rapid speed in a different direction.
After you have eluded the wily ferret your View is a lovely picnic in front of a pristine lake. Your controller sends this new data to your Model and it decides to sit down and have a delicious avocado sandwich.
Now your view is that you are out of avocado sandwiches (oh no!). So you pass that data along the Controller to your Model which decides to go home (I mean what’s the point if you don’t have avocado right?)
If that analogy didn’t sit well with you perhaps a webpage will. The HTML would be the Model, the CSS the View and the browser the Controller.
This is my long-winded way of telling you that the Model is the data, logic, or information of your program. The View is the visual representation of it and the Controller is the traffic cop that directs them.
Hopefully this helps you understand the MVC pattern a little better and I will be back next month to continue our journey.

More To Explore

Outdoor Advertising Current360 Hero Image

Advertising in the Great Outdoors.

In the 1920s, a company called Burma Shave — producers of brushless shaving cream — started putting signs up that delighted and educated drivers. These

Paul Rand Current360 Hero Image

Who Influenced the Influencers?

In advertising, pretty much everyone has been influenced by someone else. As we’ve been bringing you stories about ad legends like Bill Bernbach and George

Contact Us

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Chaney Given

Chaney is a talented and accomplished designer and illustrator, who has expanded his skill set to include motion graphics and video editing. With nearly a decade of experience, his client work includes Waterstep, Baptist Health, the Archdiocese of Louisville Catholic Schools, First Harrison Bank, and many more