
Ever since the ASP.NET MVC Framework was released I have had this passion for learning other web frameworks that implement the MVC pattern. I have been steadily learning Rails in particular as I think a lot of what has been added to the ASP.NET MVC Framework is largely in part due to Rails.
During the past week I read Ruby on Rails for Microsoft Developers
published by Wrox and I really, really enjoyed it. For me, there were 4 chapters in particular that really stood out:
- Chapter 5 - A Working Sample
- Chapter 7 - Object-Relational Mapping with ActiveRecord
- Chapter 8 - Handling Requests with ActionController
- Chapter 9 - Rendering the User Interface with ActionView
Chapter 5 takes you through the popular “blog example“ that so many Rails books and screencasts seem to use as their defacto example. What I liked about the coverage in Ruby on Rails for Microsoft Developers was that it was really detailed. The author explained each piece clearly and concisely, leaving nothing to question.
Chapter 7, Object-Relational Mapping with ActiveRecord, demystified ActiveRecord outside of Rails. I thought this was really cool, because I started writing Ruby code using ActiveRecord for the first time in a simple TextMate document without Rails. Felt liberating for some reason :) The chapter is pretty detailed about migrations, CRUD operations, associations, validation, and other topics associated with ActiveRecord.
Chapter 8 and Chapter 9 talked about the processing of actions and rendering of views that is crucial to understanding Rails. Just like with ASP.NET MVC, Rails has a process for determining which action and view is chosen to fulfill a request. Rails also has the concepts of filters ( before, after, and around filters ) similar to ASP.NET MVC as well as the ability to use render ( like View in ASP.NET MVC ) to specify what is to be rendered back to the client. Rails also has Flash, which is similar to ASP.NET MVC's TempData. In general, there is a lot of good stuff in these two chapters that help you understand how Rails processes actions and renders views.
If you are new to Ruby and worrying about not understanding the code, the book also has an introduction to Ruby at the beginning of the book to familiarize yourself with the Ruby Language used in the later chapters. However, at some point you will want to get a more detailed book on Ruby.
All in all, Ruby on Rails for Microsoft Developers
is a nice starter book for learning Rails. I now need to find a more advanced book that builds on its teachings.
David Hayden