<div class="chat-box">
     <div class="header">
         Narayan Prusty
     </div>

     <div id="messages" class="messages">
         <ul>
           <% @conversation.messages.each do |message| %>
             <li>
                 <span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
                 <div class="clear"></div>
             </li>
             <% end %>
         </ul>
         <div class="clear"></div>
     </div>

     <div class="input-box">
         <textarea placeholder="Enter message"></textarea>
     </div>
 </div>

<div class="chat-box">
     <div class="header">
         Narayan Prusty
     </div>

     <div id="messages" class="messages">
         <ul>
           <% @conversation.messages.each do |message| %>
             <li>
                 <span class="<%= message.sender == current_user ? 'right' : 'left' %>"><%= message.body %></span>
                 <div class="clear"></div>
             </li>
             <% end %>
         </ul>
         <div class="clear"></div>
     </div>

     <div class="input-box">
         <textarea placeholder="Enter message"></textarea>
     </div>
     <%= form_for @message do |f| %>
     <%= fields_for :conversation do |ff| %>
        <%= ff.hidden_field :id %>
     <% end %>
       <%= f.text_field :body, class: "form-control" %>
       <%= f.button 'Submit' %>
     <% end %>
 </div>

Add form to send a new message
Add form to send a new message
