cocoon/lib/cocoon.rb
nathanvda 1628bb19d3 Made Cocoon Rails 3.1 compatible:
- moved cocoon.js to app/assets/javascripts
- adapted install-generator accordingly (for rails 3.0.x)
- made it an engine instead of railtie (to use the asset pipeline)
2011-07-24 00:17:40 +02:00

16 lines
345 B
Ruby

require 'cocoon/view_helpers'
module Cocoon
class Engine < ::Rails::Engine
config.before_initialize do
config.action_view.javascript_expansions[:cocoon] = %w(cocoon)
end
# configure our plugin on boot
initializer "cocoon.initialize" do |app|
ActionView::Base.send :include, Cocoon::ViewHelpers
end
end
end