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", ...
Written by Andreas Grauel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#