asm-products/verba

View on GitHub
app/views/posts/_post.html.haml

Summary

Maintainability
Test Coverage
.post-teaser
  .date
    = post.date
  .post-excerpt
    = link_to truncate(post.content, length: 50), post_path(post),
      class: "post-excerpt-link"
    - if @profile.current_users_profile?
      - if post.published
        = link_to "Unpublish", unpublish_path(post.id), method: :post, class: "button-light pull-right"
      - else
        = link_to "Publish", publish_path(post.id), method: :post, data: {confirm: "Publishing post. You can always unpublish."}, class: "button-light pull-right"