Class: Hitchens::PostDecorator

Inherits:
ApplicationDecorator show all
Defined in:
app/decorators/hitchens/post_decorator.rb

Instance Method Summary collapse

Methods inherited from ApplicationDecorator

#markdown

Instance Method Details

#body_to_htmlObject



5
6
7
8
# File 'app/decorators/hitchens/post_decorator.rb', line 5

def body_to_html
  html = markdown(body)
  syntax_highlight(html).html_safe
end

#pubdate_tagObject



10
11
12
13
14
15
16
# File 'app/decorators/hitchens/post_decorator.rb', line 10

def pubdate_tag
  if publication_date
    h.time_tag publication_date, pubdate_display, pubdate: true
  else
    "(not yet published)"
  end
end