How can I make awesome_print by default in heroku console?

How can I make awesome_print by default in heroku console?

When I type Model.all in the console, I would like awesome_print to display the results without typing ap Model.all .

+5
source share
3 answers

The next gem combination seems to do it in Rails 4.

 # for the pretty gem 'pry' gem 'pry-rails' gem 'pry-doc' gem 'pry-awesome_print' gem "awesome_print" 

You can also remove the following lines from .pryrc , and it will work anyway:

 require 'awesome_print' AwesomePrint.pry! 

Happy seal!

+4
source

Try installing pry, it has features like awful printing and much more, and has installation instructions for the rails application: http://pryrepl.org/

+2
source

If you have an awesome_print gem, you just use AwesomePrint.irb! in the console and voila .. it will display the output the way you want.

0
source

All Articles