Ruby: Modules, Mixins, Fixins, and Rails - Controlling the Situation
(Page 4 of 4 )
To make an application work, you first need a controller. The controller is the evil overseer, the big boss, the big cheese, the head honcho, the imperial slave-driver. He is that guy that says: "I think the benefits of slavery outweigh its drawbacks" and then makes you carry heavy boulders back and forth.
To create this big galoot we use the following ruby command: ruby script/generate controller controllername. Below we will create a controller named Willis, in the hopes of later learning what the heck he was talking about:
ruby script/generate controller Willis
If you go to rubymyfirsttimeappcontrollers you will see a file name willis_controller.rb. This is the file you just created.
Hanging off the Side of a Cliff
Well, the time has come to end this article. But, but but...I know. We haven't yet made our first web page. But never fear: the next article will continue our discussion of Rails, and show you how to make your first bona fide web application.
Till then...
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |