From 22e166c3703cd56b13191910f4a723d0a6952d22 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 16 Jul 2012 17:38:44 +0200 Subject: [PATCH] add swf to asset pipeline. Fixes #1311 --- app/assets/javascripts/application.js | 2 +- {public => app/assets}/swfs/expressInstall.swf | Bin {public => app/assets}/swfs/open-flash-chart.swf | Bin app/views/stats/_chart.html.erb | 2 +- config/application.rb | 3 +++ 5 files changed, 5 insertions(+), 2 deletions(-) rename {public => app/assets}/swfs/expressInstall.swf (100%) mode change 100755 => 100644 rename {public => app/assets}/swfs/open-flash-chart.swf (100%) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 74bb0e45..4d064b6c 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -28,4 +28,4 @@ //= require niftycube //= require superfish //= require supersubs -//= require swfobject \ No newline at end of file +//= require swf_fu \ No newline at end of file diff --git a/public/swfs/expressInstall.swf b/app/assets/swfs/expressInstall.swf old mode 100755 new mode 100644 similarity index 100% rename from public/swfs/expressInstall.swf rename to app/assets/swfs/expressInstall.swf diff --git a/public/swfs/open-flash-chart.swf b/app/assets/swfs/open-flash-chart.swf similarity index 100% rename from public/swfs/open-flash-chart.swf rename to app/assets/swfs/open-flash-chart.swf diff --git a/app/views/stats/_chart.html.erb b/app/views/stats/_chart.html.erb index a627a69f..d8f859d6 100755 --- a/app/views/stats/_chart.html.erb +++ b/app/views/stats/_chart.html.erb @@ -1,5 +1,5 @@ <% @swf_count ||= 0 -%> -
<%= swf_tag "open-flash-chart.swf", +
<%= swf_tag asset_path("open-flash-chart"), :flashvars => { 'width' => width, 'height' => height, 'data' => data}, :parameters => { 'allowScriptAccess' => 'sameDomain', 'wmode' => 'transparent'}, :div_id => "chart_#{@swf_count+=1}", diff --git a/config/application.rb b/config/application.rb index 7de490b3..a772d67a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -63,6 +63,9 @@ module Tracksapp # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + # add /app/assets/swfs to asset pipeline for charts + config.assets.paths << Rails.root.join("app", "assets", "swfs") # configure Tracks to handle deployment in a subdir config.action_controller.relative_url_root = SITE_CONFIG['subdir'] if SITE_CONFIG['subdir']