How to stop the Rails debugger for the current request

后端 未结 9 1365
既然无缘
既然无缘 2021-02-02 15:50

Say I have a loop in my code that calls the rails debugger a few times

def show
    animals = [\'dog\', \'cat\', \'owl\', \'tiger\']
    for animal in animals
           


        
9条回答
  •  遥遥无期
    2021-02-02 16:19

    I came up with another answer to this today that I like even better:

    debugger unless @no_debug

    Use that on every line that has a debugger stop. When you want to stop stopping just set @no_debug to something.

提交回复
热议问题