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 ?
0

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

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

0

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

请先登录再写评论。