By far the most frustrating part of learning Ruby on Rails was the confusion of dealing with “Rails Magic”. I remember telling someone, “I love Ruby, but I hate Rails. There’s no logic to the things it does.”
It’s a lot like looking at a solution to a complex math problem solved by a mathematician who doesn’t bother writing out the steps she can do in her head.
An experienced mathematician will appreciate not having to write out or read those basic steps, but if someone were to try to learn math by following that example, she would be hopelessly lost.
There are a ton of things in Rails that are helpful shortcuts for experienced Rails developers, but are tremendously confusing for newbies.
For example, there is a seemingly endless number of ways to tell Rails:
If the URL is ‘www.example.com/photos/new’, you should show the template located in the file ‘photos/new.html.erb’
Amongst those endless options, the ones that are most commonly used are the ones that give you the least information about what they are doing behind the scenes.
This is true not just for routes, but for pretty much every part of Rails. It’s chock full of short-cuts and assumptions, and if you don’t know what those short-cuts and assumptions are, it can be quite difficult to understand.
For that reason, I have decided to write a series that will connect the dots between the explicit or long way of doing things and the more commonly-used shortcuts.
Coming up: Part 1: Creating an App