Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using binding.pry in Rails app's view or partial

Pry is quite amazing in my R3 app. But any chance I can use

<% binding.pry %> 

in a view or a partial like I did previously with

<% debugger %>

This doesn't seem to work. Thanks.

like image 723
valk Avatar asked Jan 29 '13 15:01

valk


2 Answers

It's always worked for me... you might need to require it.

<% require 'pry'; binding.pry %>
like image 169
Abe Voelker Avatar answered Oct 10 '22 05:10

Abe Voelker


<% binding.pry %> works well.

It doesn't work only if you didn't install pry-rails gem in your rails app.

Please post the error that you are facing if use <% binding.pry %> such that I can elaborate it more.

like image 28
Prashanth Avatar answered Oct 10 '22 05:10

Prashanth