这是_form.html.haml 的部分代码
%div
= f.label :content, "内容"
%br/
= f.text_area :content, style: "height: 500px", class: "wysihtml5"
:javascript
$(document).ready(function(){
$('.wysihtml5').wysihtml5({
"size": 'tiny',
"font-styles": false, //Font styling, e.g. h1, h2, etc. Default true
"emphasis": true, //Italics, bold, etc. Default true
"lists": false, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
"html": false, //Button which allows you to edit the generated HTML. Default false
"link": true, //Button to insert a link. Default true
"color": true, //Button to change color of font
"image": true, //Button to insert an image. Default true,
"locale": "zh-CN"
});
})
这是 show.html.haml 的部分代码
%h5= @article.content (关键是这里怎么改)
谢谢,大牛