我正在实施 Mailboxer gem,但在显示消息时遇到问题。这是我保存已发送消息的操作:
#MessagesController
def create
# current_user - ID: 253
# @user - ID: 1
@user = User.find(params[:user_id])
send_message = current_user.send_message(@user, params[:message][:body], params[:message][:subject]).conversation
puts send_message.inspect
redirect_to messages_url
end
send_message的输出是
#<Receipt id: nil, receiver_id: 253, receiver_type: "User", notification_id: nil, is_read: true, trashed: false, deleted: false, mailbox_type: "sentbox", created_at: nil, updated_at: nil>
不应该是receiver_id #1?另外,这些数据存储在哪里,在哪个表中?
当我显示已发送的消息 ( current_user.mailbox.sentbox ) 时,我看不到我刚刚发出的这条消息。当我以 ID 1 的用户身份登录时,我也看不到收到的消息。
我究竟做错了什么?
谢谢