2011-02-09 21:03:53 +00:00
|
|
|
require 'cocoon/view_helpers'
|
|
|
|
|
|
|
|
module Cocoon
|
2011-07-23 21:42:01 +00:00
|
|
|
class Engine < ::Rails::Engine
|
2011-02-09 21:03:53 +00:00
|
|
|
|
|
|
|
config.before_initialize do
|
2013-01-22 20:33:44 +00:00
|
|
|
if config.action_view.javascript_expansions
|
|
|
|
config.action_view.javascript_expansions[:cocoon] = %w(cocoon)
|
|
|
|
end
|
2011-02-09 21:03:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# configure our plugin on boot
|
|
|
|
initializer "cocoon.initialize" do |app|
|
|
|
|
ActionView::Base.send :include, Cocoon::ViewHelpers
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|