使用Mailboxer Gem缺少部分内容

我按照本教程在y rails项目中添加了messagerie。

一切似乎都很好,但我点击“已发送链接”部分消息有错误。

Missing partial mailbox/_messages, application/_messages with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder]}. * "/Users/baptiste/code/BaptisteB/bosszzd/app/views" * "/Users/baptiste/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mailboxer-0.13.0/app/views" * "/Users/baptiste/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/devise-3.5.6/app/views" 

我真的不明白,这里有一些代码:

展#查看

 

这是部分_messages.html.erb

   


Subject:
Date:

我将部分_messages.html.erb放在app/views/conversations/_messages.htm.erb

谢谢您的帮助

发送链接的路径为GET /mailbox/sent(.:format) mailbox#sent

而链接是

 <li class="">  

这是对话控制器

 class ConversationsController < ApplicationController before_action :authenticate_user! def index @receipts = Receipt.all end def new end def create recipients = User.where(id: conversation_params[:recipients]) conversation = current_user.send_message(recipients, conversation_params[:body], conversation_params[:subject]).conversation flash[:success] = "Your message was successfully sent!" redirect_to conversation_path(conversation) end def show @receipts = conversation.receipts_for(current_user) # mark conversation as read conversation.mark_as_read(current_user) end def reply current_user.reply_to_conversation(conversation, message_params[:body]) flash[:notice] = "Your reply message was successfully sent!" redirect_to conversation_path(conversation) end def trash conversation.move_to_trash(current_user) redirect_to mailbox_inbox_path end def untrash conversation.untrash(current_user) redirect_to mailbox_inbox_path end private def conversation_params params.require(:conversation).permit(:subject, :body, recipients:[]) end def message_params params.require(:message).permit(:body, :subject) end end 

MailboxController

 class MailboxController < ApplicationController before_action :authenticate_user! def inbox @inbox = mailbox.inbox @active = :inbox end def sent @sent = mailbox.sentbox @active = :sent end def trash @trash = mailbox.trash @active = :trash end end 

对话控制器

 class ConversationsController < ApplicationController before_action :authenticate_user! def new end def create recipients = User.where(id: conversation_params[:recipients]) conversation = current_user.send_message(recipients, conversation_params[:body], conversation_params[:subject]).conversation flash[:success] = "Your message was successfully sent!" redirect_to conversation_path(conversation) end def show @receipts = conversation.receipts_for(current_user) # mark conversation as read conversation.mark_as_read(current_user) end def reply current_user.reply_to_conversation(conversation, message_params[:body]) flash[:notice] = "Your reply message was successfully sent!" redirect_to conversation_path(conversation) end def trash conversation.move_to_trash(current_user) redirect_to mailbox_inbox_path end def untrash conversation.untrash(current_user) redirect_to mailbox_inbox_path end private def conversation_params params.require(:conversation).permit(:subject, :body, recipients:[]) end def message_params params.require(:message).permit(:body, :subject) end end 

视图为

部分文件夹是