awesome_print pretty prints/formats Ruby objects. This post focuses on having awesome_print enabled in the rails console without changing/updating the Gemfile. This way it is available in all Rails applications and consoles. You can always add the gem to the Gemfile and have this working for that specific rails application. gem ‘awesome_print’, :require => ‘ap’ To […]Read more "Set up awesome_print as default Rails console formatter"
rbenv is a great tool which enables you to install and pick a ruby version for your application. It is light weight and works by inserting a directory of shims at the front of the PATH Install Homebrew – a great package manager: ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Install rbenv – manage different versions on […]Read more "Install rbenv and ruby"
Do this on rails console to list models with their structure .. Rails.application.eager_load! (required on development environment) ActiveRecord::Base.descendantsRead more "Rails console – List all models"
On your Mac, add following lines in ~/.irbrc require ‘irb/ext/save-history’ #History configuration IRB.conf[:SAVE_HISTORY] = 1000 This will enable irb history which will let you access previous commands with up/down keys The actual history resides under ~/.irb_historyRead more "Enable history in irb and rails console"