Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress Rails console/irb outputs

I was testing some DB entries in our production server in Rails Console where almost all the commands were producing a huge number of lines of output and causing the ssh channel to hang.

Is there a way to suppress the console/irb screenfuls?

like image 254
ghtn Avatar asked Jan 13 '11 09:01

ghtn


1 Answers

You can append ; nil to your statements.

Example:

users = User.all; nil 

irb prints the return value of the last executed statement; thus in this case it'll print only nil since nil is the last executed valid statement.

like image 135
intellidiot Avatar answered Nov 07 '22 17:11

intellidiot