rubyonrailsin

A Ruby and Rails talk

Thursday, March 18, 2010


[Rails] differences between relative_url using Rails with Prototype or JQuery

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

My web app is deployed with Passenger in a sub-uri, 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 :
<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
<script>
$(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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive