API אחזור פוסט כתובות URL יחסיות

i actually asked chat GPT the same question and got a working answer straight away

using a helper method to replace the urls inside the cooked data

def update_urls(content)
    forum_domain = 'https://forums.xxx.com'

    # Update href attributes
    content.gsub!(/href="(\/[^"]*)"/i) { |match| "href=\"#{forum_domain}#{$1}\"" }

    # Update src attributes
    content.gsub!(/src="(\/[^"]*)"/i) { |match| "src=\"#{forum_domain}#{$1}\"" }

    content
  end

So i’ll leave this here for anyone else - if anyone has a more elegant out of the box solution i would be interested