Topic: Relative Path To Absolute Path Convertor

Is there a built in function/plugin that converts
relative paths from a html page to absolute ones?

target url:

url content:
<script src="/script.js"></script>
<a href="link.html">some link</a>

converted content:
<script src=""></script>
< a href="">some link</ a>

How can I accomplish this using ruby ?

Re: Relative Path To Absolute Path Convertor

are you not using rails?

if you are using rails for the javascript


for the link you would have to mess around with the routs to allow someone to browse html in the folder (I believe) or you would make a controller called folder and define whatever views you want...

if you are not using rails you could do something like this
[code = ruby]
Class String
  @@base = ""
  def to_link
  def to_js
then puts "<a href = #{'link.html'.to_link}>some link</a>"

untested but you could fool around with that until it worked