Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails console tips, tricks and customizations

There's this great post on irb tricks, but what about further customizing Rails console behavior and output?

Awesome print and Hirb are great.

SQL logging is a must for me. In your ~/.irbrc paste:

require 'logger'
ActiveRecord::Base.logger = Logger.new(STDOUT) if defined?(Rails)

What's your tip/trick/gem of choice?

like image 284
Mirko Avatar asked Jan 23 '11 16:01

Mirko


1 Answers

I've recently written a rails specific console tweaks blog post: https://rbjl.janlelis.com/49-railsrc-rails-console-snippets (as gist)

like image 175
J-_-L Avatar answered Nov 12 '22 06:11

J-_-L