Rich not being displayed in Rails Admin
Opened this issue · 6 comments
I use Rails Admin and I wanted to setup Rich with it. After bundle install I've run:
rails generate rich:install
rake db:migrate
I use Devise with model name Admin, so I modified /config/initializers/rich.rb
:
config.authentication_method = :authenticate_admin!
Here is my model config in config/initializers/rails_admin.rb
:
config.model Article do |a|
edit do
field :trailer_text, :rich_editor do
config({
:insert_many => true
})
end
field :news_text, :rich_editor do
config({
:insert_many => true
})
end
end
end
Here is how it all looks like:
- There are no javascript errors, just a message about fontawesome: "Resource interpreted as Font but transferred with MIME type application/font-woff: "http://localhost:3000/assets/fontawesome-webfont.woff". "
- CKEditor and Rick Javascript is loaded
- I've tried latest gem code, disabled all Chrome plugins and cleared cache
Any ideas how to debug this would be great!
[edit]: now it started to display something, link names without styling, but still no editor:
Are both: Rich CSS and JavaScript files loaded?
Strange, sometimes JavaScript is not loaded at all, and sometimes it loads assets/rich/base.js?body=1
with body:
// Wire up Rich
;
I've inspected the inline JavaScript
var instance = CKEDITOR.instances['article_trailer_text'];
if(instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace('article_trailer_text',....)
and run the code in console and this is what I got:
$ var a = CKEDITOR.instances['article_trailer_text']; => undefined
$ a = CKEDITOR.instances['article_trailer_text']; => a.editor {_: Object, elementMode: 1, element: d.element, name: "article_trailer_text", id: "cke_1"…}
var
is somehow resposible? o.O
Was there any fix to this issue? I am getting exactly the same error in active admin too
I've merged this PR locally, and it helped for me.