From de1acdf93089100ff012cb83b9b09db4fdcd3105 Mon Sep 17 00:00:00 2001 From: virusman Date: Wed, 23 Jan 2013 00:33:44 +0400 Subject: [PATCH] Make sure javascript_expansions config option exists --- lib/cocoon.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cocoon.rb b/lib/cocoon.rb index ec9039c..3118fb7 100644 --- a/lib/cocoon.rb +++ b/lib/cocoon.rb @@ -4,7 +4,9 @@ module Cocoon class Engine < ::Rails::Engine config.before_initialize do - config.action_view.javascript_expansions[:cocoon] = %w(cocoon) + if config.action_view.javascript_expansions + config.action_view.javascript_expansions[:cocoon] = %w(cocoon) + end end # configure our plugin on boot