# Including SWFs as part of rails content

**URL:** <https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043>\
**Category:** Rails\
**Created:** [June 5, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043 "2007-06-05T22:04:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 5, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/1 "2007-06-05T22:04:01Z")

</div>

I’m having difficulties developing pages that include simple SWFs as  
part of the content. Specifically, they won’t play in MSIE 6. In  
Firefox and Opera the pages play exactly as planned, both Mac and  
Windows. SWFs are located in a subdirectory of /public. Has anyone run  
into a similar problem?  
Is there a tutorial that covers this anywhere?  
Thank you

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 5, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/2 "2007-06-05T22:59:14Z")

</div>

Aren’t plugins handled differently in MSIE 6+? You can’t use Netscape  
style embed tags. Look into that and I’m guessing you’ll find your  
problem.

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 5, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/3 "2007-06-05T23:03:15Z")

</div>

> **[JW Player: End-to-End Solution for Streaming & Monetizing Video](https://jwplayer.com/)**
>
> JW Player is the #1 end-to-end video streaming solution to scale your video strategy, maximize engagement, & monetize your video content.

This should, hopefully, show you what you need to do to properly embed  
your swf file.

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 5, 2007, 11:19pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/4 "2007-06-05T23:19:17Z")

</div>

Make sure you don’t have any spaces in your file path to the SWF. When I  
had  
this problem with IE is was because of that. Also IE doesn’t use src in  
the  
embed tag if I remember properly. It used the value of the param with  
the  
attribute ‘movie’ so make sure that path is correct.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 6, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/5 "2007-06-06T19:53:20Z")

</div>

I recently had this exact same issue as well. The solution to my  
problem was exactly what Michael said, I needed:

It’s really not an issue with rails because it’s your server that  
dishes up that content. You may wanna double check the mime type your  
server is spitting out too but I doubt that’s part of the problem  
unless your server is very old (apache 1.3 or something). Not sure  
how the various browsers handle the type attribute but I wouldn’t  
count on it.

good luck!  
Tim

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 6, 2007, 6:59pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/6 "2007-06-06T18:59:08Z")

</div>

This is directed to everybody - the problem seems to be related to  
serving swf’s from inside VIEWS. It seems that you should be able to  
put a swf file in a subdirectory of RAILS\_APP/public and link to that  
swf from an embed link in a view. Is there some special problem / way  
of serving flash from IE within rails?

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 8, 2007, 7:25am UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/7 "2007-06-08T07:25:24Z")

</div>

Hi Folks,

Can I make a suggestion here? I began writing a lengthy reply to this  
subject, but figured it would be more useful to write a blog post on  
embedding SWF content in Ruby on Rails using SWFObject. So here it is:

> **[Eleventyten.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=eleventyten.com)**
>
> Get the premium .com domain you deserve. Seamless and professional transactions. Payment plans available.

HTH, let me know if you have any problems or if you have any  
comments/criticisms on the article itself and I will update it  
appropriately.

Cliff

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 12, 2007, 4:04pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/8 "2007-06-12T16:04:34Z")

</div>

Cliff,  
I think you need to escape a few more \< and \> in the text. In the  
bullet that begins “There is no need to deal with …” you have  
 and which cause problems (at least for Safari).  
-Rob

---

<div class="post-metadata">

**Author:** ![rocky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@rocky](https://www.ruby-forum.com/u/rocky)\
**Post date:** [June 12, 2007, 2:57pm UTC](https://www.ruby-forum.com/t/including-swfs-as-part-of-rails-content/106043/9 "2007-06-12T14:57:08Z")

</div>

Cliff  
great post, thanks for the help on this. I followed the SWFObject  
documentation and it works fine in IE  
Rocky
