diff --git a/app/decorators/asciicast_decorator.rb b/app/decorators/asciicast_decorator.rb index 7d8de7d..066b4d0 100644 --- a/app/decorators/asciicast_decorator.rb +++ b/app/decorators/asciicast_decorator.rb @@ -107,8 +107,12 @@ class AsciicastDecorator < ApplicationDecorator end def description - text = asciicast.description.to_s - markdown(text) + if asciicast.description.present? + text = asciicast.description.to_s + markdown(text) + else + h.content_tag :em, 'No description.' + end end def author_profile_link(options = {}) diff --git a/app/views/asciicasts/show.html.erb b/app/views/asciicasts/show.html.erb index 9ef45bb..35bf16a 100644 --- a/app/views/asciicasts/show.html.erb +++ b/app/views/asciicasts/show.html.erb @@ -9,11 +9,7 @@

<%= @asciicast.title %>

- <% if @asciicast.description.present? -%> - <%= @asciicast.description %> - <% else -%> - No description. - <% end -%> + <%= @asciicast.description %>