Everyone cool seems to agree: Ruby on Rails is an amazing way to build web (or heck, Web 2.0) applications. Ruby is a powerful and flexible programming language, and Rails takes advantage of that flexibility to build a web application framework that takes care of a tremendous amount of work for the developer. Everything sounds great!
Except, well⦠all the Ruby on Rails books talk about this âModel-View-Controllerâ thing, and they start deep inside the application, close to the database, most of the time. From an experienced Rails developerâs perspective, this makes senseâthe frameworkâs power lies largely in making it easy for developers to create a data model quickly, layer controller logic on top of that, and then, once all the hard work is done, put a thin layer of interface view on the very top. Itâs good programming style, and it makes for more robust applications. Advanced Ajax functionality seems to come almost for free!
From the point of view of someone learning Ruby on Rails, however, that race to show off Railsâ power can be extremely painful. Thereâs a lot of seemingly magical behavior in Rails that works wonderfullyâuntil one of the incantations isnât quite right and figuring out what happened means unraveling all that work Rails did. Rails certainly makes it easier to work with databases and objects without spending forever thinking about them, but there are a lot of things to figure out before that ease becomes obvious.
If youâd rather learn Ruby on Rails more slowly, starting from pieces that are more familiar to the average web developer and then moving slowly into controllers and models, youâre in the right place. You can start from the HTML you already likely know, and then move more deeply into Railsâ many interlinked components.
Note
This updated version of Learning Rails covers version 2.x up through version 2.3.5, but will mention places where Rails 3.0 will be different. The Rails 3.0 beta arrived recently, and while we canât encourage learning Rails on beta software, being ready for the future is important too.
Youâve probably been working with the Web for long enough to know that writing web applications always seems more complicated than it should be. There are lots of parts to manage, along with lots of people to manage, and hopefully lots of visitors to please. Ruby on Rails has intrigued you as one possible solution to that situation.
You may be a designer whoâs moving toward application development or a developer who combines some design skills with some programming skills. You may be a programmer whoâs familiar with HTML but who lacks the sense of grace needed to create beautiful designâthatâs a fair description of one of the authors of this book, anyway. Wherever youâre from, whatever you do, you know the Web well and would like to learn how Rails can make your life easier.
The only mandatory technical prerequisite for reading this book is direct familiarity with HTML and a general sense of how programming works. Youâll be inserting Ruby code into that HTML as a first step toward writing Ruby code directly, so understanding HTML is a key foundation. (If you donât know Ruby at all, you probably want to look over Appendix A or at least keep it handy for reference.)
Cascading Style Sheets (CSS) will help you make that HTML look a lot nicer, but itâs not necessary for this book. Similarly, a sense of how JavaScript works may help. Experience with other templating languages (like PHP, ASP, and ASP.NET) can also help, but it isnât required.
You also need to be willing to work from the command line sometimes. The commands arenât terribly complicated, but they arenât (yet) completely hidden behind a graphical interface. Even Heroku Garden, an online integrated development environment (IDE) for Rails, still has some necessary command-line features.
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.