<div class="form-input">
  <%= form_for Comment.new, url: collection_comments_path(@collection.id) do |f| %>
    <%= f.hidden_field :user_id, value: current_user.id %>
    <%= f.hidden_field :collection_id, value: @collection.id %>

    <div class="field">
      <%= f.text_area :content, class: "form-control", placeholder: "Add a comment..." %>
    </div>

    <div class="actions">
      <%= f.submit "Add Comment", class: 'btn btn-sm btn-default' %>
    </div>
  <% end %>
</div>

<% content_for :head do %>
  <%= javascript_include_tag "comments/comment" %>
<% end %>

<div class="form-input">
  <%= form_for Comment.new, url: collection_comments_path(@collection.id) do |f| %>
    <%= f.hidden_field :user_id, value: current_user.id %>
    <%= f.hidden_field :collection_id, value: @collection.id %>

    <div class="field">
      <%= f.text_area :content, class: "form-control", placeholder: "Add a comment..." %>
    </div>

    <div class="actions">
      <%= f.submit "Add Comment", class: 'btn btn-sm btn-default' %>
    </div>
  <% end %>
</div>

Include javascript in header of comment form
Include javascript in header of comment form
