SHARE:
Uncategorized

Learn Rails Concepts With Sinatra

Flatiron School / 7 November 2012

The following is a guest post by Aaron Streiter and originally appeared on his blog. Aaron is currently a student a The Flatiron School. You can learn more about him here, or follow him on twitter here.

One of the primary challenges of learning Ruby on Rails is understanding the MVC Pattern. For newbies to rails, this can be a challenge.

mvc diagram

In practice, Rails is a complex directory structure with hundreds of dependencies–not ideal for learning concepts.

If you are brand new to Rails, I suggest diving deep into Sinatra. Although Sinatra and Rails are two distinct frameworks, Sinatra can express models, views, controllers, routes on one line each, in just one file:

mvc sinatra code

Here is the code for the above app; I suggest playing around with simple apps such as these to get insight into how Rails works on a high level.

ActiveRecord Without Rails Previous Post How to Fix a RedCloth Error While Installing Octopress Next Post