safely call html_safe on category description

The `categories.description` column is not modified as "not null", so it is possible for the description to be nil. This changes the code not call html_safe on nil.
This commit is contained in:
Ryan Mulligan 2017-07-25 11:40:02 -07:00 committed by GitHub
parent 0d66a41753
commit f3f7dd02d1

View File

@ -6,7 +6,7 @@
<h2><a href='<%= c.url %>' itemprop='item'>
<span itemprop='name'><%= c.name %></span>
</a></h2>
<span itemprop='description'><%= c.description.html_safe %></span>
<span itemprop='description'><%= c.description&.html_safe %></span>
</div>
<% end %>
</div>