<div dir="ltr"><div>Let's suppose I have a command written in Ruby, that is outputting to HTML in a new window.</div><div><br></div><div>Is there a way to create a link in the HTML output that, when clicked, will actually execute a Ruby function that I define in the command?</div><div><br></div><div>For example, something like:</div><div><br></div><div>def do_something(x)</div><div>    # do something with x</div><div>end</div><div><br></div><div>puts "<a href=\"command:do_something(42)\">Edit X</a>"</div><div><br></div><div>My end goal is to provide an interface for manipulating the current document; maybe the answer is to do the logic in JS within the HTML window, and then update the document from there, but I'm equally unsure of how to do that.</div><div class="gmail_quote"></div></div>