active_admin_editor icon indicating copy to clipboard operation
active_admin_editor copied to clipboard

Problem with cache_classes = true

Open badosu opened this issue 11 years ago • 0 comments

Deploying to heroku I've seen some problems when this is set to true.

For some reason, formtastic does not reload some classes when it's needed. So I see things like:

NoMethodError: undefined method `editor' for #<ActiveAdmin::Application:0x007f08134ae5f8>
ActionView::Template::Error (Unable to find input class HtmlEditorInput)
/app/config/initializers/active_admin_editor.rb:1:in `<top (required)>': uninitialized constant ActiveAdmin::Editor (NameError)

See: https://github.com/rails/spring/issues/95 for references.

I was able to make a workaround for this error, prepending this to the initializer:

require 'active_admin_editor'
require "#{Gem::Specification.find_by_name("active_admin_editor").gem_dir}/app/inputs/html_editor_input"

This is problem an error more related to Formtastic than to this gem, but this should be useful for someone who has the same problem.

badosu avatar Jun 16 '14 05:06 badosu