3 ms·
Um, very true, but this would also be a sign that they need to read their stack traces / test outputs, and probably try a debugger. Seriously. Debugger. For
by Groxx 15y ago
Um, very true, but this would also be a sign that they need to read their stack traces / test outputs, and probably try a debugger.
Seriously. Debugger. For tests, it's as simple as `gem install rdebug` and put `debugger` in the failing test(s). When it stops on that line, type `eval instance_variables`, and viola - your array contains "@microposts" and not "@micropost". Running it against a full Rails application, especially with, say, Passenger, is a bit trickier, but it's still worth the initial effort.
- mhartl 15y agoThanks for the tip. I'll plan to cover this technique in the next version of the Rails Tutorial.