Kas*_*ail 5 truncate ruby-on-rails
我正在使用Rails 4并遇到非常奇怪的问题.原始和截断不能正常工作.
<%= raw(job.description)%> # working properly
<%= raw(truncate(job.description,:length => 200))%> # Not strip html tags
<%= truncate((raw job.description),:length => 200)%> # Not strip html tags
Run Code Online (Sandbox Code Playgroud)
问题是什么?
有什么帮助吗?
obe*_*nda 20
我不确定你要完成什么,所以干脆尝试
raw job.description.truncate(200)
Run Code Online (Sandbox Code Playgroud)
和\或
(raw job.description).truncate(200)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3061 次 |
| 最近记录: |