Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
how to pass javascript in the flas player
7 Posts
how to pass javascript in the flas player

Hi i want to pass a javascript file in the flash player. in emded code there is a option allow javascript=true so i can i give javascript path in that .

Without seeing the embed code I'll just guess you can use some inline erb to insert a variable or database field value into the embed.

I hope that helps somehow.

hi thanks for the comment i want to pass the xml file to show the realted video at the bottem of the page the problem is that i have to write that xml file in the public folder when i give the path of the view it gives me errors in public directory i have to made deffrent --2 file at each time so each there is any solutions for that Thanks

This is the emded code

Hi Amit, I just dealt with an issue like this recently and noted it in "this post":http://www.workingwithrails.com/forums/4/topics/83-create-an-xml-file-in-memory.

I'll recap here quickly though. I was able to send the xml data directly to the flash player without creating a file at all by creating a controller that calls send_data to send the generated xml. I then inserted inline ruby calling "url_for" to supply a "file path" to flash object like so using your example embed code:

So no files to clean up, no time wasted writing/reading from the file system. Works really well for me.

I wish I could make things clearer but I hope this helps anyway.

Hi Thanks for comment but still i have problem my conroller code is

def test12

send_data stream, :filename => 'videos/test12.rxml', :type => 'text/xml', :disposition => 'inline'

and the rxml code is here

 xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"

xml.recommendations do
xml.recommendation do
     xml.title('Reporting sdssfrom Mint')

But recomnadation is still not working can u figure out this Thanks

7 Posts
Login to add your message