I have HTML documents that contain image tags . I need to pick out each image tag's source attribute and specify a full path instead of the relative path already present . That is to append the absolute path .
Current Version :
<img src = '/assets/rails.png' />
After transformation :
<img src = 'http://localhost:3000/assets/rails.png' />
What would be the cleanest and most efficient way to do this in RoR ?
Addition
I am going to use the transformed HTML as a string and pass it to IMgKit gem for transformation into an image .