I am using the mailboxes gem in rails 4. I am trying to make it so that when A user goes to another user's profile, they click on a button on that profile that sends the second user a message. For example, A goes to B's profile and clicks the message button. B will then get a message from a. On the profile page, I have the following code:
<%=current_user.send_message(@user, "Body", "subject") %>
I've also tried placing the code above in a link_to tag but that does not work. On the Receive messages page, I have the following code that I got from the documentation:
Conversations:
<%= current_user.mailbox.conversations %>
Inbox:
<%= current_user.mailbox.inbox %>
But nothing appears in either the inbox code or the conversations code. Please help. Thanks.