kreativgebiet/rich

Issue with rails_admin on Rails 4.1.0 and Ruby 2.1.1?

Opened this issue · 1 comments

Hello everyone.

I tried using Rich with rails_admin following the documentation here. Rich wouldn't work until I changed :rich_editor to :ck_editor. It wouldn't load CKEDITOR until that, it was showing Uncaught ReferenceError: CKEDITOR is not defined, in the console log. Here's the solution that worked for me (in rails_admin.rb):

  config.model Post do
    edit do
      field :title
      field :body, :ck_editor do
        config({
          :insert_many => true
        })
      end
    end
  end

Is this a compatibility issue or I did something wrong on the way?

EDIT 2: The first time I open /admin I get this, but it's gone after page reload.

NoMethodError (undefined method `config' for #<RailsAdmin::Config::Fields::Types::CKEditor:0x00000004e1cd88>):
  config/initializers/rails_admin.rb:39:in `block (4 levels) in <top (required)>'
  config/initializers/rails_admin.rb:38:in `block (3 levels) in <top (required)>'
  config/initializers/rails_admin.rb:36:in `block (2 levels) in <top (required)>'

EDIT: I'm using the latest version of Rich gem.

Your config must be:

config.model Post do
      edit do
        field :body, :ck_editor, :text do
          label 'body'
        end
      end
    end