My site provides a javascript that shows the rate of the Dutch equivalent of the Dow Jones index. Users can embed this script in their website.
It looks like this:
<script type="text/javascript" src="http://www.aexscript.nl/r/gratis"></script>
The corresponding controller action looks like this:
def show
@script = Script.find_by_code(params[:code])
@rate = Rate.find(:first)
respond_to do |format|
format.js # show.js.erb
end
end
I want to log the URL of the site the javascript has been embedded on. How can I do this?