Listing pms

<% message = @pms.where(recipient: current_user) %> <% unless message.empty? then message.each do |pm| %> <% end %> <% else %> <% end %> <% message = @pms.where(author: current_user) %> <% unless message.empty? then message.each do |pm| %> <% end %> <% else %> <% end %> <% conversation1 = current_user.mailbox.inbox.first %> <% if !conversation1.nil? %> <% receipts1 = conversation1.receipts_for current_user %> <% receipts1.each do |receipt1| %> <% message1 = receipt1.message %> <% end %> <% else %> <% end %> <% conversation1 = current_user.mailbox.sentbox.first %> <% if !conversation1.nil? %> <% receipts1 = conversation1.receipts_for current_user %> <% receipts1.each do |receipt1| %> <% message1 = receipt1.message %> <% end %> <% else %> <% end %>
Author Recipient Message

Inbox

<%= pm.author.user_name %> <%= pm.recipient.user_name %> <%= pm.message %> <%= link_to 'Show', pm %> <%# link_to 'Edit', edit_pm_path(pm) %> <%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the author\'s copy)?' } %>

No New Messages

Outbox

<%= pm.author.user_name %> <%= pm.recipient.user_name %> <%= pm.message %> <%= link_to 'Show', pm %> <%# link_to 'Edit', edit_pm_path(pm) %> <%= link_to 'Delete', pm, method: :delete, data: { confirm: 'Are you sure (also deletes the recipient\'s copy)?'} %>

No New Messages

Conversations

Inbox

<%= message1.subject %> <%= message1.body %>

No Messages

Outbox

From Subject Body
<%= message1.subject %> <%= message1.body %>

No Messages


<%= link_to 'New Pm', new_pm_path %>