a7em-g
Last Updated: February 25, 2016
·
1.725K
· daemonsy
493e873b1593892192b2cede3c69ffc5

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

Say Thanks
Respond