lib/ckeditor/engine.rb in ckeditor-3.7.3 vs lib/ckeditor/engine.rb in ckeditor-4.0.0.rc1
- old
+ new
@@ -3,13 +3,11 @@
module Ckeditor
class Engine < ::Rails::Engine
isolate_namespace Ckeditor
- config.action_view.javascript_expansions[:ckeditor] = "ckeditor/ckeditor"
-
- initializer "ckeditor.assets_precompile", :group => :assets do |app|
+ initializer "ckeditor.assets_precompile", :group => :all do |app|
app.config.assets.precompile += Ckeditor.assets
end
initializer "ckeditor.helpers" do
ActiveSupport.on_load(:action_controller) do
@@ -22,16 +20,19 @@
ActionView::Helpers::FormBuilder.send :include, Ckeditor::Helpers::FormBuilder
end
end
initializer "ckeditor.hooks" do
- # Don't load the hook for Formtastic < 2.0.0 that (it crashes), apparently, didn't define a Formtastic::Inputs.
- if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs")
+ if Object.const_defined?("Formtastic")
require "ckeditor/hooks/formtastic"
end
if Object.const_defined?("SimpleForm")
require "ckeditor/hooks/simple_form"
+ end
+
+ if Object.const_defined?("CanCan")
+ require "ckeditor/hooks/cancan"
end
end
end
end