hummingbird-me/hummingbird

View on GitHub
app/views/quotes/_votes.html.haml

Summary

Maintainability
Test Coverage
%span{:class => "quote_#{quote.id}_votes"}
  = pluralize quote.positive_votes.to_i, "likes"
  - if current_user && current_user.voted_for?(quote)
    = link_to main_app.vote_anime_quote_path(quote.anime_id, quote, type: "down"), method: :post, remote: true do
      %i.fa.fa-star
  - else
    = link_to main_app.vote_anime_quote_path(quote.anime_id, quote, type: "up"), method: :post, remote: true do
      %i.fa.fa-star-o