ujh/fountainpencompanion

View on GitHub
app/views/blog/index.html.slim

Summary

Maintainability
Test Coverage
- content_for :title, 'Blog'

- @posts.each do |post|
  div.fpc-blog-post
    h2.fpc-blog-post__title= link_to post.title, blog_path(post)
    div.fpc-blog-post__published-at=l post.published_at, format: :long
    p.fpc-blog-post__body
      = Slodown::Formatter.new( \
          truncate(post.body, length: 500, separator: ' ') { link_to 'more', blog_path(post) } \
        ).complete.to_s.html_safe

= paginate @posts