I am trying to figure out a (better) way to do the following:
some_string = “Display a widget here - 1234”
new_string = replace_widgets_in_string(some_string)
p new_string => #Display a widget here - Widget 1234 is blue"
the method replace_widgets_in_string will need to pick out the xml tag
and value (which will be the model id) and from there I will find the
model and return a string that replaces the widget tags.
Is there an existing library or easy way to do this that I might not be
thinking of? I am assuming rexml wont work, since its not a well formed
doc. I want to avoid coding a monolithic method using string splits.
Any ideas?