title: How to prevent enter key submit in rails
body: <p>Simple example:</p>
  
  <pre><code> &lt;%= form_for :post, url: posts_path  do |f|%&gt;
      &lt;p&gt;
          &lt;%= f.label :title%&gt;&lt;br/&gt;
          &lt;%= f.text_field :title%&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;%= f.label :text%&gt;&lt;br/&gt;
          &lt;%= f.text_area :text%&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;%= f.submit%&gt;
      &lt;/p&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>I think this is a Rails default event handling. In here, if the user presses the enter key, it submits the <code>params</code>.</p>
  
  <p>But in my case, I have to use the enter key for another event.</p>
  
  <p>I have to search <code>users</code> with another input field by pressing the enter key.</p>
  
  <p>But if I use <code>form_for</code> it submits the form. :(</p>
  
  <p>How can I prevent submitting with the enter key in <code>rails</code>?</p>
  
  <p>Do I have to use plain html tags? Like <code>&lt;form&gt; tag</code> and <code>&lt;submit&gt; button</code>?</p>
  
  <p>Any good solutions?</p>