fix tickets bug with no description

This commit is contained in:
Michael Ball 2020-07-07 22:24:28 -07:00
parent 8d322f56ef
commit 0e9d6b491b
2 changed files with 6 additions and 1 deletions

View file

@ -21,4 +21,9 @@ module ConferenceHelper
'%20Sponsorship'
].join
end
def short_ticket_description(ticket)
return unless ticket.description
markdown(ticket.description&.split("\n").first&.strip)
end
end

View file

@ -20,7 +20,7 @@
%h3.text-center.word_break
= ticket.title
.word_break
= markdown(ticket.description.split("\n")&.first.strip)
= short_ticket_description(ticket)
%button.btn-block.btn.btn-lg.btn-success
%i.fa.fa-ticket.fa-fw{"aria-hidden": true}
= humanized_money_with_symbol(ticket.price)