Building a Ruby on Rails application requires mastering a complicated set of skills. You may find thatâdepending on how youâre working with it, and who youâre working withâyou only need part of this tour. Thatâs fine. Just go as far as you think youâll need.
At the beginning, youâll need to install Ruby on Rails. Weâll explore different ways of doing this, with an emphasis on easier approaches to getting Ruby and Rails operational.
Next, weâll create a very simple Ruby on Rails application, with only a basic view and then a controller that does a very few things. From this foundation weâll explore ways to create a more sophisticated layout using a variety of tools, learning more about Ruby along the way.
Once weâve learned how to present information, weâll take a closer look at controllers and what they can do. Forms processing is critical to most web applications, so weâll build a few forms and process their results, moving from the simple to the complex.
Forms can do interesting things without storing data, but after a while itâs a lot more fun to have data that lasts for more than just a few moments. The next step is setting up a database to store information and figuring out how the magic of Railsâ ActiveRecord makes it easy to create code that maps directly to database structuresâwithout having to think too hard about database structures or SQL.
Once we have ActiveRecord up and running, weâll explore scaffolding and its possibilities. Rails scaffolding not only helps you build applications quickly, it helps you learn to build them well. The RESTful approach that Rails 2.0 chose to emphasize will make it simpler for you to create applications that are both attractive and maintainable. For purposes of illustration, using scaffolding also makes it easier to demonstrate one task at a time, which we hope will make it easier for you to understand whatâs happening.
Ideally, at this point youâll feel comfortable with slightly more complicated data models, and weâll take a look at applications that need to combine data in multiple tables. Mixing and matching data is at the heart of most web applications.
Weâll also take a look at testing and debugging Rails code, a key factor in the frameworkâs success. Migrations, which make it easy to modify your underlying data structures (and even roll back those changes if necessary), are another key part of Railsâ approach to application maintainability.
The next step will be to add some common web applications elements like sessions and cookies, as well as authentication. Rails (sometimes with the help of plug-ins) can manage a lot of this work for you.
Weâll also let Rails stretch its legs a bit, building more exciting Ajax applications and sending email messages. Finally, weâll show you one approach to bringing your Rails application to a wider public, deploying it with MySQL and Phusion Passenger, as well as exploring some other possibilities.
By the end of this tour, you should be comfortable with working in Ruby on Rails. You may not be a Rails guru yet, but youâll be ready to take advantage of all of the other resources out there for becoming one.
Get Learning Rails: Live Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.