Search code examples
rubyhpricot

How do I add text to an empty element in Hpricot?


If I have an empty tag:

<tag/>

How can I add text so that I end up with:

<tag>Hello World!</tag>

I can only seem to swap the whole tag with different content or add content before/after it.


Solution

  • Seems I just needed to use the call:

    my_node.inner_html my_content