I am using bootstrap-markdown to add a markdown editor to my page and save the content parsed to html in the database. The problem is that (although i believe it should) it does not save the html result but the raw text instead.
this is my code:
<div class="well col-md-10 col-md-offset-1">
<%= form_for(:post, :url => {:action => 'create'}) do |f| %>
<%= f.text_field(:title, class: 'form-control')%>
<%= f.text_field(:description, class: 'form-control')%>
<%= f.text_area(:content, rows: 15, "data-provide" => "markdown")%>
<%= f.button "Submit", type: 'submit', class: 'btn col-md-4 col-md-offset-4 btn-large btn-success' %>
<% end %>
</div>
I have added the libraries as follows:
//= require jquery
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require markdown.js
//= require to-markdown.js
//= require bootstrap-markdown-bundle
//= require_tree .
*= require_tree .
*= require_self
*= require bootstrap-markdown
This is the html output:
<button class="btn col-md-4 col-md-offset-4 btn-large btn-success" name="button" type="submit">Submit</button>
See Question&Answers more detail:os