

Draft chapters of the Ruby on Rails Tutorial, 3rd Edition - mhartl
http://news.railstutorial.org/rails_tutorial_3rd_edition/

======
chollida1
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.

~~~
rubiquity
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.

0 - [https://pragprog.com/book/rails4/agile-web-development-
with-...](https://pragprog.com/book/rails4/agile-web-development-with-rails-4)

1 - [http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-
Professio...](http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professional-
Series/dp/0321584104)

~~~
adi-pradhan
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."

~~~
rubiquity
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.

------
DanielKehoe
Wow! I am mentioned in Chapter 1.

> 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).

------
pzaich
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.

~~~
jarrettch
My first time going through(and then second time a few weeks later), I totally
ignored the tests and felt like I was better for it as well.

------
billturner
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:

[http://draft.railstutorial.org/book/rails_flavored_ruby#code...](http://draft.railstutorial.org/book/rails_flavored_ruby#code-
application_layout_full_title)

first code block here (with a wrapped "g"):
[http://draft.railstutorial.org/book/rails_flavored_ruby#sec-...](http://draft.railstutorial.org/book/rails_flavored_ruby#sec-
back_to_the_title_helper)

~~~
mhartl
Weird. Those code blocks look fine locally, so that's a bug. Will fix ASAP.

UPDATE: They actually look fine in Chrome, but not in Firefox! I'm digging
into it now.

UPDATE 2: Looks like it's working now

~~~
billturner
Well, that's odd. They have the wrapped characters in Mac Chrome for me, but
_not_ in FF.

Another comment says change deployed but they're still off in Chrome on Mac
(even with a forced/shift reload):
[http://imgur.com/IIaUiav](http://imgur.com/IIaUiav)

------
gyardley
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.

~~~
mhartl
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/](http://installrails.com/)) service
provided by One Month Rails.

~~~
ambulancechaser
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.

~~~
mhartl
_Please don 't take the advice to downplay rspec._

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.

------
arikrak
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](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.)

------
hayksaakian
Hi Michael

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

------
pookieinc
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.

~~~
mhartl
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.

------
habosa
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.

------
mhartl
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.

------
Bahamut
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.

------
waffl
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!

------
rev
Michael, let me ask two predictable questions.

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".

2\. Will the Rails version be fixed at 4.1?

~~~
mhartl
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.

~~~
rev
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.

~~~
mhartl
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.

------
sergiotapia
Nice to see the testing toned down a lot.

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.

------
amrtnz
do you recommend using an online IDE only for beginners or is it something you
would utilize for your own projects?

~~~
mhartl
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.

~~~
amrtnz
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!

------
diasks2
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?

~~~
snlacks
I agree, great tutorials. I was also wondering the same thing about Bitbucket.

~~~
mhartl
See [Box 1.4]([http://draft.railstutorial.org/book/beginning#aside-
github_b...](http://draft.railstutorial.org/book/beginning#aside-
github_bitbucket)). The tl;dr is that Bitbucket is free for private repos,
which for security purposes the new edition uses by default.

~~~
snlacks
Thanks for also replying, I wouldn't have seen this otherwise.

------
ch4s3
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?

~~~
mhartl
I don't plan to cover APIs in the core tutorial, but I've had a couple of
requests for that subject and will consider making a follow-on product.

