kreativgebiet / rich

:money_with_wings: An opinionated CKEditor editor for Rails with flexible image uploads
MIT License
418 stars 238 forks source link

rails_admin: Unsupported field datatype: rich_editor #80

Open Inza opened 11 years ago

Inza commented 11 years ago

I have just downloaded stable version of rails_admin (0.4.6) and stable version of rich (1.4.6)

I made:

bundle install

rails generate rich:install

and

rake db:migrate

Everything works well.

I am have this in my rails_admin.rb in my model:

edit do
  group :default do
    field :html, :rich_editor do
      config({
        :insert_many => true
      })
    end
  end
end

And it worked well for me in my other apps when I have used rich with success. But I had older versions of both the rails_admin and rich.

Now I run my app and I got:

RuntimeError - Unsupported field datatype: rich_editor

Some folk had this issue as well and created a question on SO: http://stackoverflow.com/questions/13070784/fail-to-integrate-ckeditor-in-rails-admin-gem-use-gem-rich

But no answers are there yet.

Maybe this is a fault in rails_admin somewhere? They were adding fixed related to JSON which they uses when loading field types (https://github.com/sferik/rails_admin#action-required-security-issue) - at least if I understand it correctly.

Could you have a look at it please?

My call stack: Screen Shot 2013-03-31 at 17 23 48

RuntimeError - Unsupported field datatype: rich_editor:
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/fields/types.rb:12:in `load'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/has_fields.rb:24:in `field'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/fields/group.rb:33:in `field'
  config/initializers/rails_admin.rb:271:in `block (4 levels) in <top (required)>'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/has_groups.rb:13:in `group'
  config/initializers/rails_admin.rb:267:in `block (3 levels) in <top (required)>'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/sections.rb:31:in `block (2 levels) in included'
  config/initializers/rails_admin.rb:266:in `block (2 levels) in <top (required)>'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/lazy_model.rb:14:in `method_missing'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config.rb:318:in `block in visible_models'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config.rb:318:in `visible_models'
  /Users/inza/.rvm/gems/ruby-1.9.2-p290@juicymo-web/bundler/gems/rails_admin-8533e5abccf8/lib/rails_admin/config/actions/dashboard.rb:19:in `block (2 levels) in <class:Dashboard>'
  (eval):8:in `dashboard'
  (gem) actionpack-3.2.7/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  (gem) actionpack-3.2.7/lib/abstract_controller/base.rb:167:in `process_action'
  (gem) actionpack-3.2.7/lib/action_controller/metal/rendering.rb:10:in `process_action'
  (gem) actionpack-3.2.7/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:502:in `_run__1555848011432546696__process_action__4456820906778252536__callbacks'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:405:in `__run_callback'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:81:in `run_callbacks'
  (gem) actionpack-3.2.7/lib/abstract_controller/callbacks.rb:17:in `process_action'
  (gem) actionpack-3.2.7/lib/action_controller/metal/rescue.rb:29:in `process_action'
  (gem) actionpack-3.2.7/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  (gem) activesupport-3.2.7/lib/active_support/notifications.rb:123:in `block in instrument'
  (gem) activesupport-3.2.7/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  (gem) activesupport-3.2.7/lib/active_support/notifications.rb:123:in `instrument'
  (gem) actionpack-3.2.7/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  (gem) actionpack-3.2.7/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  (gem) activerecord-3.2.7/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  (gem) actionpack-3.2.7/lib/abstract_controller/base.rb:121:in `process'
  (gem) actionpack-3.2.7/lib/abstract_controller/rendering.rb:45:in `process'
  (gem) actionpack-3.2.7/lib/action_controller/metal.rb:203:in `dispatch'
  (gem) actionpack-3.2.7/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  (gem) actionpack-3.2.7/lib/action_controller/metal.rb:246:in `block in action'
  (gem) actionpack-3.2.7/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  (gem) actionpack-3.2.7/lib/action_dispatch/routing/route_set.rb:36:in `call'
  (gem) journey-1.0.4/lib/journey/router.rb:68:in `block in call'
  (gem) journey-1.0.4/lib/journey/router.rb:56:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/routing/route_set.rb:600:in `call'
  (gem) railties-3.2.7/lib/rails/engine.rb:479:in `call'
  (gem) railties-3.2.7/lib/rails/railtie/configurable.rb:30:in `method_missing'
  (gem) journey-1.0.4/lib/journey/router.rb:68:in `block in call'
  (gem) journey-1.0.4/lib/journey/router.rb:56:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/routing/route_set.rb:600:in `call'
  (gem) rack-pjax-0.7.0/lib/rack/pjax.rb:12:in `call'
  (gem) rack-raw-upload-1.1.1/lib/rack/raw_upload.rb:18:in `call'
  (gem) meta_request-0.2.1/lib/meta_request/middlewares/app_request_handler.rb:11:in `call'
  (gem) rack-contrib-1.1.0/lib/rack/contrib/response_headers.rb:17:in `call'
  (gem) meta_request-0.2.1/lib/meta_request/middlewares/headers.rb:16:in `call'
  (gem) meta_request-0.2.1/lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
  (gem) warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
  (gem) warden-1.2.1/lib/warden/manager.rb:34:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  (gem) rack-1.4.5/lib/rack/etag.rb:23:in `call'
  (gem) rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/head.rb:14:in `call'
  (gem) remotipart-1.0.5/lib/remotipart/middleware.rb:30:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/flash.rb:242:in `call'
  (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
  (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/cookies.rb:338:in `call'
  (gem) activerecord-3.2.7/lib/active_record/query_cache.rb:64:in `call'
  (gem) activerecord-3.2.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:405:in `_run__795378196810170562__call__991007877746934064__callbacks'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:405:in `__run_callback'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  (gem) activesupport-3.2.7/lib/active_support/callbacks.rb:81:in `run_callbacks'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/reloader.rb:65:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  (gem) better_errors-0.7.2/lib/better_errors/middleware.rb:84:in `protected_app_call'
  (gem) better_errors-0.7.2/lib/better_errors/middleware.rb:79:in `better_errors_call'
  (gem) better_errors-0.7.2/lib/better_errors/middleware.rb:56:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  (gem) railties-3.2.7/lib/rails/rack/logger.rb:26:in `call_app'
  (gem) railties-3.2.7/lib/rails/rack/logger.rb:16:in `call'
  (gem) quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/request_id.rb:22:in `call'
  (gem) rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
  (gem) rack-1.4.5/lib/rack/runtime.rb:17:in `call'
  (gem) activesupport-3.2.7/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  (gem) rack-1.4.5/lib/rack/lock.rb:15:in `call'
  (gem) actionpack-3.2.7/lib/action_dispatch/middleware/static.rb:62:in `call'
  (gem) railties-3.2.7/lib/rails/engine.rb:479:in `call'
  (gem) railties-3.2.7/lib/rails/application.rb:220:in `call'
  (gem) rack-1.4.5/lib/rack/content_length.rb:14:in `call'
  (gem) railties-3.2.7/lib/rails/rack/log_tailer.rb:17:in `call'
  (gem) rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
  /Users/inza/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  /Users/inza/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  /Users/inza/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
ideaoforder commented 11 years ago

+1

bradwheel commented 11 years ago

+1

jimmyn commented 10 years ago

+1

zekitow commented 8 years ago

+1

tarunjadhwani commented 7 years ago

+1