_explication: display champ.description instead of champ.value

This commit is contained in:
simon lehericey 2018-02-28 17:14:00 +01:00
parent 902cd1b4d9
commit 28c4dde96d
4 changed files with 39 additions and 4 deletions

View file

@ -2,4 +2,10 @@ module ChampHelper
def is_not_header_nor_explication?(champ)
!['header_section', 'explication'].include?(champ.type_champ)
end
def html_formatted_description(description)
html_formatted = simple_format(description)
with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>')
sanitize(with_links, attributes: %w(href target))
end
end