rma*_*002 4 html ruby-on-rails ckeditor
我正在使用ckeditor for rails 3并且我已经在表单中设置了它,除了视图部分以外工作得很好,当我去模型显示页面我标记我用于文本格式但没有粗体字或任何其他修改我对文本做了.问题出在哪儿?我是否必须在呈现此文本的字段旁边添加一些内容,就像我在表单中所做的那样?
表单的代码工作得很好
<div class="field">
<%= f.cktext_area :comments, :cols => 80, :rows => 20 %>
</div>
Run Code Online (Sandbox Code Playgroud)
并在show.html.erb
<p style="margin-left:5px;text-align:justify;padding:5px;"><%= @car.comments %></p>
<p> <em>The 2011 Cadillac Escalade ranks 1 out of 9 Luxury Large SUVs. This ranking is
based on our analysis of 86 published reviews and test drives of the Cadillac Escalade, and
our analysis of reliability and safety data.The 2011 Cadillac Escalade is not for shrinking
violets. It’s an SUV for buyers who like to be noticed, but who also need the
capabilities of a full-sized truck-based SUV – and are willing to pay to get them.
</em>
Run Code Online (Sandbox Code Playgroud)
这就是结果,因为你看到文本周围有标签但是它们被转义.谢谢你的时间.
rma*_*002 13
好.我知道了.我只是需要在场前的原始.例如<%= raw@car.comments %>或
<%= raw(car.comments) %>取决于你需要它们.感谢Google :).