增加方法判断:将/n转还成<br/>

This commit is contained in:
sw 2015-07-17 17:30:48 +08:00
parent 159d8f644e
commit b981c4d07b
3 changed files with 6 additions and 2 deletions

View File

@ -2343,4 +2343,8 @@ module ApplicationHelper
end
end
#将文本内的/n转换为<br>
def text_format text
text.gsub("\n","<br/>").html_safe
end
end

View File

@ -19,7 +19,7 @@
编程代码:
</span>
<div class="show_hwork_p break_word">
<%= textilizable @work.description%>
<%= text_format @work.description%>
</div>
<div class="cl"></div>
</li>

View File

@ -36,7 +36,7 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="show_hwork_p break_word">
<%= textilizable @work.description%>
<%= text_format @work.description%>
</div>
<div class="cl"></div>
</li>