roseweixel/lacquer-lover

View on GitHub
app/views/users/_lacquer_gifts_received_not_acknowledged.html.erb

Summary

Maintainability
Test Coverage
<% user.lacquer_gifts_received_not_acknowledged.each do |gift| %>
  <% friend = User.find(gift.owner_id) %>
  <% lacquer = Lacquer.find(gift.user_lacquer.lacquer_id) %>
  <div class="list-group-item" style='padding-top: 15px;'>
    <strong><%= link_to friend.name, user_path(friend) %></strong> has given you <strong><%= link_to lacquer.name, lacquer_path(lacquer) %></strong>!<br>

    <%= link_to "Got it!", gift_path(:id => gift.id, gift: {:state => "acknowledged"}), method: 'patch', class: "btn btn-success btn-xs" %><br><br>
  
    <%= link_to "send #{friend.first_name} a message", new_transactional_message_path(:gift_id => gift.id) %>

  </div>
<% end %>