If I, say, loop through all the instances of a given model and output something from each, at the end, irb will still print the entire object.
If the object ends up taking hundreds of lines, it'll be a long way up before I see what I was actually looking for. Is there a way to disable this in the rails console?
We can exit the Rails console by typing exit.
On Mac OS X or Linux you can use Ctrl + L to clear the IRB screen. @fanaugen On MacOS, cmd+k will clear all within a terminal tap, if you use tmux to split area of the visual area, ctrl+L will do a better work.
The console command lets you interact with your Rails application from the command line. On the underside, bin/rails console uses IRB, so if you've ever used it, you'll be right at home. This is useful for testing out quick ideas with code and changing data server-side without touching the website.
The Rails console. provides a way to interact with your GitLab instance from the command line. The Rails console interacts directly with GitLab. In many cases, there are no handrails to prevent you from permanently modifying, corrupting or destroying production data.
If you don't want to disable the echo in general you could also call multiple expressions in one command line. Only the last expression's output will be displayed.
big_result(input); 0
Call conf.echo = false
and it will not print the return value. This works for any irb session, not just Rails console.
In case you want to make it permanent, add it to your irb config.
echo 'IRB.conf[:ECHO] = false' >> $HOME/.irbrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With