Someday I may expand this to a longer post on Ruby debugging, but until then I am writing it down so I don’t have to search for it on Stack Overflow again.
If you need to debug an erb snippet in irb
, this function gives you
a handy shortcut for combining the template and arbitrary instance
variables. Copy it into your irb session:
And then you can use it as follows:
Kind of handy especially if you need to test out some ruby inside the <%= %>
tag.