# Differences between relative\_url using Rails with Prototype or JQuery

**URL:** <https://www.ruby-forum.com/t/differences-between-relative-url-using-rails-with-prototype-or-jquery/185363>\
**Category:** Rails\
**Created:** [March 18, 2010, 7:19pm UTC](https://www.ruby-forum.com/t/differences-between-relative-url-using-rails-with-prototype-or-jquery/185363 "2010-03-18T19:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [March 18, 2010, 7:19pm UTC](https://www.ruby-forum.com/t/differences-between-relative-url-using-rails-with-prototype-or-jquery/185363/1 "2010-03-18T19:19:27Z")

</div>

My web app is deployed with Passenger in a sub-uri,  
[http://www.mydomain.com/vacademy/](http://www.mydomain.com/vacademy/)  
and I am displaying a player in a page  
the swf is located in …/public/dist/flowplayer-3.1.5.swf

Using Prototype library I wrote a script :

 $f("player", "./dist/flowplayer-3.1.5.swf", { .... and I don't have any problem to get the player installed from http://www.mydomain.com/vacademy/dist/flowplayer-3.1.5.swf but when using jQuery $(function() { ...... $f("player2", "./dist/flowplayer-3.1.5.swf", { ... the .swf is not found as the relative url is based on the controller ... http://www.mydomain.com/vacademy/mycontroller/dist/flowplayer-3.1.5.swf is there anyway to bypass this behavior, not using a relative path or getting the rails public path in js ? thanks for your help erwin
