I have the mailboxer gem and I have avatars displaying. In the message view it works, but in the inbox it is showing 2 avatars for each message. One avatar is from the sender and the other is from recipient (current_user). It should only be showing the avatar from the sender.
I believe it's showing both when a conversation is created.
Does someone know how I can restrict it so that inside the inbox it shows avatar of sender only?
Conversation inbox:
<%= content_tag_for(:li, conversation) do |conversation| %>
<%= link_to conversation.subject, conversation%> - <%= conversation.updated_at.strftime("%B %-d, %Y %l:%M%P") %>
| From: <% conversation.participants.each do |participant| %>
<% if participant != current_user %>
<%= link_to participant.username, participant %>
<% end %>
<% end %>
<%= content_tag_for(:li, conversation.receipts_for(current_user)) do |receipt| %>
<% message = receipt.message %>
<%= image_tag message.sender.avatar.image_url(:avatar) %>
<% end %>
<% if conversation.is_completely_trashed?(current_user)%>
<%= link_to 'Untrash', [:untrash, conversation], method: :post%>
<%else%>
<%= link_to 'Move to trash', [:trash, conversation], method: :post%>
<% end %>
<% end %>