0
3.0 사용 살균 및 simple_format, 나는 p
i
br
등과 같은 안전 html 태그 일부 단락을 렌더링 (및 잘라 내기) 할,이 코드를 사용 html 태그가있는 단락 나는이보기 내 application_helper레일 내보기에 application_helper
def paragraph(text, length)
"#{sanitize(simple_format(truncate(text, :length => length)), :tags => %w(p i br b))}"
end
에 해당 코드를 통과 할 때
는 그러나
- @last_testimony.each do |last_testimony|
= paragraph(last_testimony.description, 10)
이
< p>My paragraph < /p>
어떻게 그것을 해결하기 위해
를 렌더링? 안전 태그로 단락을 렌더링하는 더 좋은 방법이 있습니까? 그것을 할 수