Nifty last result in IRB ( result = _ )
1.9.3p194 :048 > Product.find(32) # Shit I forgot to assign it a var for manipulation
1.9.3p194 :049 > product = _ # No fear, use _ for the last result.
In Rails Console/IRB, using var = _ will assign the last result to the statement.
Super nifty because I tend to forget the assignment, mind's on constructing the statement.
I first saw this in one of Ryan Bates' railscast episode. Felt like a better man ever since =)
Written by Damon Aw
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#