简体   繁体   中英

How do I link to an item in the public folder from views/controller_name/page1.html.erb in Ruby on Rails?

I need to embed a flash movie into one of the pages in my Ruby on Rails app. I've put the Flash movie into the public folder, but I'm not sure how to reference it from my page, which is located at views/controller_name/page1.html.erb . How do I do this?

Thanks for reading.

link_to , eg (assuming it's in the public folder):

<%= link_to "My Hot Link Test", "/flashmovie.swf" %>

The leading "/" isn't strictly necessary, I think.

Sorry, missed the bit where you wanted to embed it, not link to it. Contrary to the title of this question. ;-) This is one easy way: http://agilewebdevelopment.com/plugins/flashobject

we have done this, But we have just use plan html

say your flash banner is at /public/flash/ folder

this is nothing but plain html

If someone have a better option please let me know too

cheers sameera

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM