I am trying to figure out a (better) way to do the following: some_string = "Display a widget here - <widget>1234</widget>" 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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

