Having problems embedding my .swf file in rails 3.1. In past versions of rails I'd use s开发者_如何学Cwfobject and simply do:
<div id="swfbox">you don't have flash</div>
<script type ="text/javascript">
swfobject.embedSWF("swf/AudioRecorder.swf", "swfbox", "400", "400", "10.0.0", "");
</script>
This isn't working in rails 3.1. I'm starting to understand the asset pipeline but I'm still confused where to put the .swf file. So far I've tried of putting everything in /public then /app/assets with a combination using:
<%= asset_path("swf/AudioRecorder.swf") %>
You should be able to put it in any directory you like under app/assets, then reference it with
<%= asset_path("AudioRecorder.swf") %>
精彩评论