문제

I have the following method:

  def update
    loan = Loan.find(params[:id])
    pry
    respond_with loan.update(loan_params) 
  end

So I would expect that when I get to pry in the console I should be able to type loan and get the object but instead I get "undefined local variable or method 'loan'", am I doing something wrong?

도움이 되었습니까?

해결책

You'll need to use binding.pry which will load pry in the scope of your current object (I think pry just loads a pry session without the scope.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top