我正在使用wysihtml5和bootsrap-wysihtml5-rails作为文本编辑器。这将是一个双管齐下的问题。我有粗体/斜体/下划线等在表单中工作,但它不保存为HTML。 它看起来像这样:
<b>Title</b>
它应该是这样的:
标题
我应该添加什么来将表单另存为html?
第二个问题:图片上传采用链接,然后用图片标签包装。有没有办法可以上传图像(通过回形针)?
这是我的表格:
<%= simple_form_for [@post, Comment.new] do |f| %>
<%= f.input :body %>
<%= f.input :image %> #want this to be in the text editor add-link
<% end %>
comments.js.coffee:
$(document).ready ->
$(".wysihtml5").each (i, elem) ->
$(elem).wysihtml5()