<%= form_for message, remote: true,uthenticity_token: true do |f| %>
  <%= f.label :your_message %>:
  <%= f.text_area :content, class: "form-control", data: {textarea: "message"},id:"textfield1" %>

  <%= f.hidden_field :chatting_id, value: chatting.id %>
  <%= f.submit "send", class: "btn btn-primary", data: {send: "message"}, id:"ClearFields" %>
<% end %>

<script>
$("#new_message").bind("ajax:complete", function(event,xhr,status){
  $('#textfield1').val('');
});
</script>
