froala / wysiwyg-rails

Ruby gem for Froala jQuery WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
465 stars 102 forks source link

Wysiwyg html not rendering #43

Closed austinklenk closed 7 years ago

austinklenk commented 7 years ago

Gem File

rails version 5.0.0.1
gem "wysiwyg-rails", :git => 'https://github.com/froala/wysiwyg-rails.git'

Gem List to Show Verision of Gem

wysiwyg-rails (2.4.0)

application.scss

  *= require froala_editor.min.css
  *= require froala_style.min.css
  *= require font-awesome

application.js

//= require froala_editor.min.js

_form.html.erb

<%= f.text_area :description, :id => 'edit' %>

javascript in form

$(function() {
          $('#edit').froalaEditor({
            heightMin: 100,
            heightMax: 200
          })
      });

Album Show Page

        <div class="col-md-6">
            <div class="fr-view">
                <%= @album.description %>
            </div>
        </div>

My issue is when i go to view the show page the html styles do not render in the browser from the wysiwyg editor, everything in my app has its structure and there styles working, but just not the text created from the wysiwyg editor doesn't render

for example This is the show page of the data from the wysiwyg screen shot 2016-12-14 at 11 37 05 am

Note: The wysiwyg form renders fine. everything in the form works.

Thank you

stefanneculai commented 7 years ago

You would have to use html_safe method to mark the HTML as safe to be rendered: http://apidock.com/rails/String/html_safe