This is big question to answer here and explain .I think you want to display listing of all the users and for every user there would be a profile page(show ). what you need to do is create controller having same name as devise name.I can give you small idea about that.
Class UsersController < ApplicationController
def index
@users = User.all
end
def show
@user = User.find(params[:id]) //you can change it according to rails4 standards
end
....
....
....
end
with this you can display all user and display there profiles.
Now for messaging you need to create a different model Message and which will have fields sender,receiver and msg .both sender and receiver will be user_id ,sender you can get from session and receiver you can get from profile itself.and remember user can have many messages
But for making this real time you have to use web sockets which will be different question to answer.