Module: Ecm::Blog::Post::Markdown

Included in:
Ecm::Blog::Post
Defined in:
app/models/ecm/blog/post.rb

Instance Method Summary collapse

Instance Method Details

#body(format: nil) ⇒ Object



31
32
33
34
35
36
37
38
# File 'app/models/ecm/blog/post.rb', line 31

def body(format: nil)
  case format
  when :html
    to_markdown(read_attribute(:body))
  else
    read_attribute(:body)
  end
end