18
So I’ve been doing a lot of (ghetto) programming in Ruby/Rails lately and while I’m still following a lot of tutorials in order to figure out my own needs, I am continually surprised at how intelligent RoR appears to be.
Case-in-point:
In order to create a new controller (this post isn’t going to attempt to describe what/how controllers are/work), one needs to run the ruby function of “script/generate controller [controller-name]” at the terminal. The ruby function will create all the necessary building blocks of your new controller for you (or fail) and output the results via the terminal, all ready for you to customize and code to your delight.
Now, one would assume you need to type the request to ruby exactly as I’ve put it above - apparently this is not so! See my screenshot and look for the script/generate call I make (it follows the “…/testapp administrator$” part)
Can you believe that? I typed “contrller Category” instead of “controller Category” and the bugger still worked! Ruby was kind enough to see my fat-finger screwup and still created the Category controller for me!
God love Ruby!







Categories