Mr.D Mr.D - 7 months ago 10
Ruby Question

Rails_admin show text written by CKEditor with html format

I have integrated CKEditor for my rails_admin. In

edit
page I have added CKEditor and wrote text.

In my model showing page it shows me like that:
enter image description here

My code for
show
:

show do
include_all_fields

end


What I need to add, to show my text, written on CKEditor, able to show in rails_admin?

==== UPDATE ====

I have added
config.assets.precompile += %w( ckeditor/* )
code in my
production.rb and development.rb
. Then I have run rake assets precompile tasks and restarted my server. It still shows the same thing in my image above.

Even If it will be possible to show text in html format, it will born new question. As you can see in image, there is
img
tag and its
src
shows not full directory of my uploaded image. If I need to send this formatted text as JSON to my phone?

==== UPDATE ====

I have opened code inspector of my browser to see
description
part of my page. It showd me this:
browsers code inspector

My html code, created by CKEditor, is written well, but my browser does not consider it as html code and there is quotation marks. Does these quotation marks affect to my browser to show it as bare text?

Answer

I have found solution. I don't know is it good or not:

show do
  include_all_fields

  field :description do
    pretty_value do
      value.html_safe
    end
  end
end