0
0
Fork 0
mirror of https://github.com/ENSL/ensl.org.git synced 2025-01-22 17:21:10 +00:00
ensl.org/app/helpers/articles_helper.rb

13 lines
304 B
Ruby
Raw Normal View History

module ArticlesHelper
def preview_text(article, full)
if article.text_coding == Article::CODING_HTML
content = article.text.html_safe
else
content = article.text_parsed.html_safe
end
content = truncate(raw(strip_tags(content)), length: 200) if !full
content
end
end