How to use helpers in pry-byebug?

269 Views Asked by At

In the rails console, we can prepend helper. to helpers to use them, like so:

helper.time_ago_in_words(Time.now - 60*60*2)

but this doesn't work in the server console during a pry-byebug debugging

How can I use a method like time_ago_in_words after starting debugging with binding.pry?

1

There are 1 best solutions below

0
On

To test helper into console or debugger(i'm not 100% sure) try with:

ApplicationController.helpers.time_ago_in_words(Time.now - 60*60*2)