Reputation: 836
Using the rails gem mailboxer
I have just started using it but I see that the SocialStream code base is quite heavy and doesnt provide a simple overview
I'd like to know how to properly work with notifications, so that if a message is sent, the receiver user clicks the message (in part of a conversation) so that it marks the message as read, this in turn will show the sender that the message is read by the receiver
Using the examples I cant seem to get it working. If I use
current_user.mailbox.inbox.unread_messages_count
I seem to get a static number that doenst change, even if I mark all my messages as read
Does anyone have a view on how to do this?
Also how do I empty all messages, conversations, receipts etc
Upvotes: 0
Views: 846
Reputation: 36
As per the Mailboxer readme, I saw this as the recommended way:
current_user.mailbox.inbox({:read => false}).count
I think that should update every time you refresh
Upvotes: 1