MongoDB
0
Вклад в тег
class MessagesController < ApplicationController
before_action :correct_user, only: [:index]
private
def correct_user
redirect_to root_path unless @conversation.sender_id == current_user.id || @conversation.receiver_id == current_user.id
end
end