app/controllers/room_messages_controller.rb
# Create the message in conversation and broadcast that into conversation
Create the message in conversation and broadcast that into conversation
Create the message in conversation and broadcast that into conversation
def create
    @message = current_user.room_messages.build(room: @conversation, message: params[:room_message][:message])
    if @message.save
      RoomChannel.broadcast_to @conversation, @message
    else
      redirect_to room_path(@conversation)
    end
  end
def create @message = current_user . room_messages . build ( room : @conversation , message : params [ :room_message ] [ :message ] ) if @message . save RoomChannel . broadcast_to @conversation , @message else redirect_to room_path ( @conversation ) end end
Create the message in conversation and broadcast that into conversation
Create the message in conversation and broadcast that into conversation