Agile Web Development with Rails – Chapter 4
</p>
Cool! Now I get to start building stuff.
Chapter 4
I just pop open my kermit green command line window and type “rails demo”. And BAM! We’ve got ourselves an application! Ok, so it might not do much yet. But it’s given me a nice “filing cabinet” to keep everything organized. Everything from the controllers source code, views, database scripts, test fixtures, configuration files, log files, scripts, images, etc. All in a nicely organized tree. Very nice.
Now I just fire up a the built-in web server using “ruby scriptserver”, open up browser and there we go. We have a full working application. That entire process, from generating the application, starting the server and browsing to the application literally took about 5 seconds.
At this point it takes me through the obligatory Hello World implementation. I can just use the rails generator to create a controller named “Say” with a method named “Hello”, then create a quick rhtml view named “hello.rhtml” in the appropriate appviewssay directory and that’s it. What’s really great about all of this style of development is that I never have to restart the internal web server because in development mode, automatically detects file changes and reloads them instantly. Try that in C#.
Then it just takes me through adding some controller code and I get to discover some more of the elegance of the Ruby language. Stuff like “3.times” and “1.hour.from_now”. How cool is that! Some basic ERb (Embedded Ruby) commands are then shown for linking to other actions. I’m pretty familiar with this kind of thing in MonoRail already. The way you can use hashes in Ruby is very nice, and is very similar to how Ayende implemented then in Brail.
Well that’s about it for now. This was just a demo app. Looks like next I get to start building a “real” application. Woohoo! 🙂