0

I am new to rails. Currently I am working on developing a forum with Forem gem on rails 4.1.5. I am using CKEditor with Forem. In Forem when I upload an image it is not displayed in the output, although it is saved (as i can see the image in the editor when i click on edit).

Doing inspect element I found that the image tag is not present in the output. I have tried to search but have not found any solution. The only discussion I was able to get was this: https://github.com/radar/forem/issues/428

I am using CKEditor in an other part of my app where the images are being stored and displayed. I only find this issue in the Forem. How can i get the images to be displayed?

Joel Peltonen
  • 13,025
  • 6
  • 64
  • 100

1 Answers1

0

I ran into the same problem. To fix it, I edited /app/views/forem/posts/_post.html.erb and changed this line:

<%= forem_format(post.text) %> 

to instead look like:

<%= post.text.html_safe %>

When I made this change, the images displayed.

reuben
  • 3,360
  • 23
  • 28
Paul C
  • 1