title: Add remote: => true on Form_for
body: <p>In my _form.html.erb file, I have;</p>
  <pre><code>&lt;%= form_for(@document) do |f| %&gt; 
  &lt;% end %&gt;
  </code></pre>
  <p>When I add</p>
  <pre><code>&lt;%= form_for(@document), :remote =&gt; true do |f| %&gt; 
  &lt;% end %&gt;
  </code></pre>
  <p>I get an error. I want to add ajax to this form so the user can submit it, it'll appear with a notice saving &quot;saved&quot; and then the user can carry on writing in the textarea within the form.</p>
  <p>The error says:</p>
  <pre><code>SyntaxError in Documents#edit
  
  Showing /app/views/documents/_form.html.erb where line #1 raised:
  
  &lt;%= form_for(@document), :remote =&gt; true do |f| %&gt;
  </code></pre>
  <p>It's saying that line 1 (above) is a syntax error.</p>
  <p>How can I add remote true to the form_for so I can add Ajax?</p>
  <h3>Update</h3>
  <p>So out of the two answers, I have;</p>
  <pre><code>&lt;%= form_for(@document, :remote =&gt; true) do |f| %&gt;
  </code></pre>
  <p>and</p>
  <pre><code>&lt;%= form_for @document, :remote =&gt; true do |f| %&gt;
  </code></pre>
  <p>They both work but is one better than the other or do they end up doing the same thing?</p>