Permalink
Browse files

Fix Rails 4 compatibility

  • Loading branch information...
1 parent 478c70c commit 10801aaedb2b9a2bcd19bec235d4d6553d5adaef @spohlenz committed Dec 8, 2012
Showing with 12 additions and 2 deletions.
  1. +1 −1 app/assets/javascripts/tinymce/preinit.js.erb
  2. +3 −1 lib/tasks/tinymce-assets.rake
  3. +8 −0 lib/tinymce/rails/engine.rb
@@ -1,5 +1,5 @@
window.tinyMCEPreInit = window.tinyMCEPreInit || {
- base: '<%= TinyMCE::Rails::Engine.config.tinymce.base || asset_path("tinymce", :digest => false) %>',
+ base: '<%= TinyMCE::Rails::Engine.base %>',
query: '<%= TinyMCE::Rails::VERSION %>',
suffix: ''
};
@@ -1,4 +1,6 @@
-Rake::Task['assets:precompile:primary'].enhance do
+assets_task = Rake::Task.task_defined?('assets:precompile:primary') ? 'assets:precompile:primary' : 'assets:precompile'
+
+Rake::Task[assets_task].enhance do
assets = File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/tinymce")
target = File.join(Rails.public_path, Rails.application.config.assets.prefix)
@@ -14,5 +14,13 @@ class Engine < ::Rails::Engine
include Helper
end
end
+
+ def self.base
+ config.tinymce.base || default_base
+ end
+
+ def self.default_base
+ File.join(Rails.application.config.assets.prefix || "/", "tinymce")
@sprestel

sprestel Jan 16, 2013

Contributor

Handling of RAILS_RELATIVE_URL_ROOT is missing.
Exists any chance of compliance of this configuration parameter?

+ end
end
end

0 comments on commit 10801aa

Please sign in to comment.