Byebug and web console do not work

In my Rails application, I can use byebug in the controller.

However, not adding byebug or console to the field of view helps me get a debug console.

I use Haml, so this is not <% console %> . In other words, the lines (one of two in time) that I used in the view are as follows:

 byebug console 

I have not tried Pry or Pry-debug, but apparently they also do not work in views?

Am I using these gems incorrectly or is there another way to add debugging in the views?

Thanks, Kumar.

+5
source share
3 answers

try to do - byebug in your line

+3
source

To expand on @ bf34's answer , you just need to tell haml that byebug is the code that needs to be run. You can do this by specifying - (e.g. - byebug ) as described in the HAML link

+3
source

For me, this work worked.

  <% byebug %> 

Hope he is for you too!

0
source

Source: https://habr.com/ru/post/1244883/


All Articles