Skip to content

Instantly share code, notes, and snippets.

@keeperofthenecklace
Created August 19, 2012 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keeperofthenecklace/3395057 to your computer and use it in GitHub Desktop.
Save keeperofthenecklace/3395057 to your computer and use it in GitHub Desktop.
Debugger Technique
#gemfile
gem 'debugger', group: [:development, :test]
#/app/controllers/tasks_controller.rb
def index
debugger
@today_tasks = Task.due_on(Date.today)
end
#terminal
$ rails s
@today_tasks = Task.due_on(Date.today)
(rdb:1)
#terminal
(rdb:1)help
(rdb:1) list (l)
(rdb:1) next (n)
(rdb:1) step (s)
(rdb:1) pp @today_tasks
(rdb:1) pp @today_tasks.map(&:due_at)
(rdb:1) irb (puts you in rails console)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment