2014-03-04 43 views
0

我有郵箱寶石,我有頭像顯示。在消息視圖中,它可以工作,但在收件箱中,它爲每條消息顯示2個頭像。一個頭像來自發件人,另一個來自收件人(current_user)。它應該只顯示發件人的頭像。頭像顯示在發件人和收件人的收件箱中

我相信它會在創建對話時顯示。

是否有人知道我可以如何限制它,以便在收件箱中顯示發件人的頭像?

對話的收件箱:

<%= 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 %> 

回答

相關問題