In my Rails application, I am able to use byebug in controller.
However, neither adding byebug
or console
in view is helping me to get a debug console.
I am using Haml, thus it's not <% console %>
. In other words, the lines (one of the two at-a-time) I used in the view are:
byebug
console
I haven't tried Pry or Pry-debug, but apparently they also don't work in views?
Am I using these gems incorrectly or is there another way to add debugs in views?
Thanks, Kumar.
try doing - byebug
on its own line
To expand on @bf34's answer, you may just need to tell haml that byebug
is code that needs to be run. You can do this by preceding it with -
(e.g. - byebug
) as explained in the HAML reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With