I have no affiliation with the author, but I'd recommend this book to pretty much anyone trying to learn Rails, I own the second edition.
Before this book I'd never done any real web programming. My background is in compilers and trading systems/machine learning( those two are essentially one in the same), all C++ desktop software.
The book got me up and running, better than any of the online rails tutorials, and there are a lot of rails tutorials online.
One thing I really appreciated was that it didn't just build an app, it actually took you through the steps of deploying on Heroku and using git.
A Lot of other books and tutorials seem to assume you want to build an app and run it as localhost for the rest of its life.
The other nice touch was the chapter that teaches a Rails flavoured Ruby. As someone who had used Ruby for scripting, but never for Rails, I thought this was a nice touch.
I actually recommend strongly against this book. It teaches things new people to Rails, let alone people new to programming, don't need to be messing with so early on. I'm mainly talking about the use of RSpec and some of the outdated Rails idioms.
For myself and a few people I've mentored, Agile Web Development with Rails[0] has yielded much better results. If they follow that up with Eloquent Ruby[1] they will be golden and well ahead of their peers with similar experience.
This book single-handedly breeds the "I'm a Rails Programmer!" that write terribly awful Ruby code that we all know and hate.
I don't mean to discredit Michael's hard work. Writing and maintaining a book like this is a huge achievement that I'm probably not capable of. I also appreciate that his book is at least bringing people into the Rails ecosystem. I just can't recommend it over others.
yeah i wasn't too fond of the use of non-omakase stuff but i believe that is now resolved
"100% default stack. The 3rd edition of the Ruby on Rails Tutorial uses the default Rails choices for all relevant technologies, thereby substantially reducing the configuration necessary to get started. The excellent but syntactically heavy RSpec testing framework has been replaced with the default Rails testing stack (MiniTest), making for a much gentler introduction to testing than in previous editions."
This is good to hear. I'm glad to see RSpec removed. A better example site than a microblog would be an even better step in the right direction. Learning to program via building social website clones needs to stop. I've called out all the Developer Bootcamps that do that kind of teaching, too.
I also have the second edition and can't praise it enough. I have a computer science degree but never really applied it to actual development as I am a business analyst in my professional life. This book bridged the gap and I quickly became proficient enough in Rails to develop a side project.
Second all of this, thanks for the wonderful book. I can truthfully say it was a major positive factor in advancing my career in software development, and for that I'm quite grateful! So thank you for the book and all the hard work and effort that goes into writing and maintaining it.
> If you still find this tutorial too difficult, you might try starting with "Learn Ruby on Rails" by Daniel Kehoe...
Thank you, Michael. It's generous to mention my book. I've said that we need a better introduction for beginners and I'm overjoyed to see the improvements in the 3rd Edition. In the last two years, so many more people want to learn Rails, often without any background in other web platforms (or even programming).
Very encouraging to see tests used more sparingly. I was a novice developer when I first tried this tutorial and found myself lost in the weeds when I tried to follow along with rspec. Understanding the difference between rspec and cucumber probably isn't critical at that point. The tutorial made a lot more sense to me after someone recommended ignoring the tests the first time through.
I agree. I've been through the book multiple time, and while excellent, nothing seemed to stick because the details of building the application itself seemed to get lost in the weeds. I'm really looking forward to diving into the new edition!
I totally agree with chollida1. This is always the first tutorial I point people at.
Is it possible to add "overflow: scroll" to the code sample blocks' CSS? I get a few characters flow down to the next line which is a bit ugly. A couple of examples:
OK, it's working now on my end. (The trick was changing the font size on code blocks from "85%" to "84%".) Let me know if you still run into any issues.
These sound like really awesome improvements - that installation and configuration cliff and the heavy use of RSpec were the two things that kept me from recommending the 2nd Edition to beginners.
If you've got time, it'd be nice to see the installation and configuration chapter make it in as an appendix, since new programmers are going to want to set up their development environment at some point - it's just better to have it at the end of the book, when they've hopefully already gotten hooked.
Thanks for the suggestion and for the kind words. Instructions for setting up a local development environment are already effectively an appendix, because the Ruby on Rails Tutorial just defers to the excellent [InstallRails](http://installrails.com/) service provided by One Month Rails.
Hello. Thank you so much for the book and the pioneering model that you have published it with. All the best on the platform for distribution.
Please don't take the advice to downplay rspec. I think in chapter 8 you update the User model. It was so incredibly nice that, having been a week or so since I was able to work on the project, I was confident that the introduced changes did not break any functionality of the app. It is very easy to not see the benefit of testing when learning, only to curse your luck when you look at code later.
I have recently read a good article using your test suite as an example of how to improve tests. The author criticized the terse nature of your tests, with subject and nested describes. He felt that you write once and read often, so there is great benefit to making the tests verbose. It is, in effect, a contract that any User model must satisfy to be a valid user model. Going DRY and code golf on it only helps to frustrate the person looking to acclimate themselves to a project rather than saving a few minutes during test creation.
Again all the best and thanks for the wonderful tutorial and interesting distribution network.
I think you may be confusing RSpec with testing generally. The 3rd edition replaces RSpec with the default Rails testing framework (MiniTest), but it still develops a thorough test suite.
I learned Rails with this tutorial (for Rails 3), which was good, but I thought it covered too much testing which is a bit overwhelming for someone starting off. Its everything-at-once approach also made it harder to reference topics afterwards. The changes in this edition like they'll be pretty helpful. It's also cool that he'll be using a default Cloud9 environment so people don't need to worry about installing anything.
However, I still think there's space for a fully modular approach to learning Rails instead of covering so many topics at once. For example, users could first learn how to use Active Record to interact with data on its own, and only later learn the other steps to building an app. This would also make it easy to look up topics later or just jump into the parts you're interested in. It would also be cool if users were given tasks with pre-written tests (but without solutions) so they would need to figure out the solution on their own and immediately see if they got it right.
(I even thought of creating a small Rails tutorial on http://www.learneroo.com but I can't currently run Rails on it. I guess one could either use an online IDE like Cloud9 or setup a custom Docker environment.)
Similarly to what others have mentioned, I've also found Hartl's Ruby on Rails online edition to be the most comprehensive and impressive tutorial yet. I'd already had a strong foundation on Git, Heroku, TDD-testing, etc. but it was nice to see how they integrated so well with a Rails project and I personally believe they are both beneficial and critical for any web application development.
However, after a cursory glance at the tutorial, I was surprised to see how embedded Cloud9 was in this new version and that seems to be the route Hartl has taken. I'm wondering if anyone has used Cloud9 and what impressions they have?
Great work! Looking forward to taking a deeper look into the tutorial.
Thanks for the kind words. To allay your concerns, Cloud9 isn't embedded at all; it's just the recommended environment if you don't already have something set up. Anyone who already has Ruby installed, has a favorite text editor, and knows how to use a command-line terminal can still follow the tutorial as written.
Thank you for creating this resource, I used your book to learn ruby on rails.
I think all of the changes you made make sense to a person new to rails and they solve problems/walls I hit while progressing through the book:
- setup/configuring rails. In my case I was using non standard hardware, a web IDE eliminates the issue
- default stack: while going through the book, I was also referring to the official rails documentation, which uses defaults like mini-test and not rspec. Juggling two testing frameworks as someone new to web development was overwhelming.
- test lite: same as above
- version specific features: removing another point of failure is good
- highlighting lines: not sure, but it's good to see innovation
This is not only the best tutorial-style book I have ever read, but probably the best book there is to get into web programming for someone who has never done it. This book totally demystifies the process from start to finish:
* What's a web framework?
* Why do I want one?
* How do I set up useful version controi?
* How do I build an app?
* How do I test my app?
* How do I deploy my app to the real world?
No other book I have ever seen answers so many questions so eloquently. Thanks mhartl, you are doing something great for new web developers everywhere.
Thanks for the kind comment. You've discovered the reason for the slight rebranding in the title, which is now Learn Web Development: The Ruby on Rails Tutorial. I feel that with this 3rd edition the tutorial has definitively transcended its original niche, and no longer principally constitutes an introduction to Rails per se.
This is also why criticisms of the sample app (e.g., a Twitter clone) are off the mark: all but the final two chapters are geared not toward a particular app, but rather to the general problem of web development. The last two chapters exist mainly to introduce some non-trivial data modeling, but once you have the foundation in place, you're ready to start building whatever kind of application you have in mind.
As noted in the announcement, I think this is the best edition yet. I'm planning to monitor the HN comments today, and I'd be happy to answer any questions.
I'd like to thank Michael for putting so much work into this - it has helped me obtain a baseline of knowledge to get into web development as my career about 2 years back (even though I have been mostly doing JavaScript professionally), and I recommend it wholeheartedly to anyone interested in trying to learn about web development.
As someone who purchased the previous version, I emailed Michael to ask if upgrade pricing would be available. He responded immediately saying there will indeed be upgrade coupons for existing owners, which is good news. I really learned a lot from this book and am looking forward to the updates!
1. When do you expect to complete the 3rd edition? Seeing as the book is being heavily reworked and knowing your attention to detail, I guess the answer is "when it's ready".
I expect the full 3rd edition draft will be released within a couple of weeks. I hope to make a full launch (with screencasts) some time in October or November.
I expect to use Rails 4.1 unless 4.2 is out of beta in time to use for the screencasts. I've compartmentalized the version-specific material, though, so I'm cautiously optimistic that I can swap in new Rails versions (even in the screencasts) as they're released.
Do you intend to make use of new 4.2 goodness or simply make the tutorial 4.2-compatible? Granted, some of the improvements in 4.2 are out of scope for the book (like ActiveJob), some are performance related, but there is also web console. It fits the philosophy of the new edition perfectly and would be a useful addition to the book.
I'd love to make the tutorial Rails 4.2–compatible before the final revision ships. It really depends on how soon 4.2 final is released. And I'll take a look at web console, which seems like it could be useful.
So far I've only used them for the tutorial, but I definitely expect to start using cloud IDEs for real projects as well. They've really come of age in the last year or two. I suggest giving the recommended cloud IDE a try to see if it might meet your needs as well.
Thanks so much for replying! I am president of the Coding Club in my high school, and a lot of the rails teaching that I'm doing is based off of what I learned in your book. The school doesn't allow installing software on the computers, so using a Cloud IDE will be perfect for us. Thank you so much for writing such a great tutorial!
Previous versions had way too much emphasis on testing, something I'd say unfortunately even 70% of real working Rails developers don't do in real projects.
Michael, great work as always. Your tutorials helped me to get up to speed on Rails quickly. Just curious, is there any particular reason you switched from GitHub to Bitbucket in your tutorial?
I looks great so far, I'm really excited about the extended auth section. Have you ever given any thought to adding a section on working with/building APIs?
Before this book I'd never done any real web programming. My background is in compilers and trading systems/machine learning( those two are essentially one in the same), all C++ desktop software.
The book got me up and running, better than any of the online rails tutorials, and there are a lot of rails tutorials online.
One thing I really appreciated was that it didn't just build an app, it actually took you through the steps of deploying on Heroku and using git.
A Lot of other books and tutorials seem to assume you want to build an app and run it as localhost for the rest of its life.
The other nice touch was the chapter that teaches a Rails flavoured Ruby. As someone who had used Ruby for scripting, but never for Rails, I thought this was a nice touch.