I installed the ckeditor gem:
https://github.com/galetahub/ckeditor
I followed all the steps and I’m displaying it like this:
<%= form_for(@post) do |f| %>
<%= render 'shared/error_messages' %>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :content %><br />
<%= f.cktext_area :content, :input_html => { :value => "Default value" } %>
</div>
<div class="field">
<%= f.label :tag_name %>
<%= f.autocomplete_field :tag_name, autocomplete_tag_name_posts_path, :"data-delimiter" => ' ' %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
and this is how I show the content:
<p><%= @post.content %></p><br />
But the output are the actual HTML tags. For instance:
<p> Default v<strong>al</strong>ue s<u>ada</u>sd</p>
How can I make it so that it actually renders the final HTML?
Rails escapes the output by default so you have to use raw:
Be careful using raw though, it’ll open you up to XSS attacks if you’re allowing untrusted users to output HTML on your site.