レコードID116は存在しないため、@conversationにnilを返す必要があります。
nilになったときにリダイレクトさせようとしましたが、example.com / messages / show?id=116にアクセスするとエラーが表示されます。
エラーは
未定義のメソッド`is_participant? ' nilの場合:NilClass
/usr/local/lib/ruby/gems/1.9.1/gems/mailboxer-0.7.0/app/models/conversation.rbに「is_participant」メソッドが存在することは間違いありません。
messages_controller.rb
def show
@conversation = Conversation.find_by_id(params[:id])
unless @conversation.is_participant?(current_user)
flash[:alert] = "You do not have permission to view that conversation."
redirect_to :controller => 'messages', :action => 'received'
end
@messages = Message.find_by_id(params[:id])
current_user.read(@conversation)
end