Debug erb file in ruby ?

I am not using sinatra erb or rails erb framework, however I will like to debug erb ( internally there is ruby code) .

Is it possible to debug into erb file using the debugger when I using following call ?

puts ERB.new("hello.erb")

I try to breakpoint the ruby code in hello.erb but rubymine does not step into it , however it run the ruby code inside the erb file.
Do i need to do special setup to debug the erb file or is debugging into erb file currently not supported ?
3 comments
Comment actions Permalink

In order to debug erb file, you need to provide proper file name for that template. You can do it like this:

erb = ERB.new(File.read(filename))
erb.filename = filename
0
Comment actions Permalink

Good tip.  Where would I put that code, however?  Thanks... 

0
Comment actions Permalink

You need to find where ERB instance is created and replace it with sample above.

Rails ERB templates should be fine without any additional work

0

Please sign in to leave a comment.