how to put the form in index action

how to put the current user sending and the receiving messages in one
form with out duplicate receiver id? if possible please give the
solution?

and also in the same form hoe to put the reply action for sending the
messages to the receiver id?

tell me the solution with any example?

Thanks,

I’m not sure what you mean by message, reply and so on. Seems something specific of your app. When I have to display the form on the index action I put the form in a separate partial, which is a good idea anyway and the default since Rails 3.1 or 3.0, like _form, and I make sure both index and new initialize the object for the form.

how to send a message to the receiver, if the receiver id is
automatically selected like in facebook or in gmail?

i have send a message to a particular person, he receives the message
and he replies to the sender without selecting the sender id ?is
possible?
Give me the solution?

Thank's