rainforestapp/swfobject-rails

Name: swfobject-rails

Owner: Rainforest QA

Description: Integration of swfobject with the Rails 3.x asset pipeline

Created: 2015-08-18 22:08:20.0

Updated: 2015-08-18 22:08:21.0

Pushed: 2013-09-16 17:54:06.0

Homepage: https://github.com/gucki/swfobject-rails

Size: 141

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rails 3.1 Integration for SWFObject

This gem integrates SWFObject with the Rails 3.1 asset pipeline.

Installation

Just add it to your Gemfile:

"swfobject-rails"
Quick Start

Add to your application.js:

require swfobject

Place your SWFs you want to incude somewhere in the rails 3.1 assets directories (ex. app/assets/swfs/…).

swfobject-rails includes a helper for generating static embed code, #swf_tag:

swf_tag "video", :id => "my_video", :params => { :loop => true }, :flashvars => { :debug => true } do %>
>You should download the latest Flash player!</p>
nd %>

This would generate the following HTML:

ect id="my_video" name="my_video" width="100%" height="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
aram name="movie" value="/assets/video.swf" />
aram name="wmode" value="transparent" />
aram name="loop" value="true" />
aram name="allowfullscreen" value="true" />
aram name="allowscriptaccess" value="always" />
aram name="flashvars" value="debug=true" />
--[if !IE]>-->
<object data="/assets/video.swf" width="100%" height="100%">
  <param name="wmode" value="transparent" />
  <param name="loop" value="true" />
  <param name="allowfullscreen" value="true" />
  <param name="allowscriptaccess" value="always" />
  <param name="flashvars" value="debug=true" />
  <!--<![endif]-->
    <p>You should download the latest Flash player!</p>
  <!--[if !IE]>-->
</object>
--<![endif]-->
ject>
ipt type="text/javascript">
fobject.registerObject("my_video", "9.0.0", "/assets/expressInstall.swf");
ript>
Updating

When new versions swfobject are released, simply update the gem to the latest version.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.