Last Updated: February 25, 2016
·
1.513K
· angrauel

Last Return Value in Rails Console

The underscore '_' is a placeholder variable for the last return value in IRB and Rails console.

Loading development environment (Rails 3.2.8)
1.9.3p194 :001 > Room.last
=> #<Room id: 1, name: "room name", ...
1.9.3p194 :002 > var = _
=> #<Room id: 1, name: "room name", ...