forked from marcandre/swf_fu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
10 lines (8 loc) · 807 Bytes
/
init.rb
1
2
3
4
5
6
7
8
9
10
require 'action_view/helpers/asset_tag_helper'
require File.dirname(__FILE__) + "/lib/action_view/helpers/swf_fu_helper"
require File.dirname(__FILE__) + "/lib/action_view/helpers/asset_tag_helper/swf_asset"
# ActionView::Helpers is for recent rails version, ActionView::Base for older ones (in which case ActionView::Helpers::AssetTagHelper is also needed for tests...)
ActionView::Helpers.class_eval { include ActionView::Helpers::SwfFuHelper } # For recent rails version...
ActionView::Base.class_eval { include ActionView::Helpers::SwfFuHelper } # ...and for older ones
ActionView::TestCase.class_eval { include ActionView::Helpers::SwfFuHelper } if defined? ActionView::TestCase # ...for tests in older versions
ActionView::Helpers::AssetTagHelper.register_javascript_include_default 'swfobject'