title: Whats wrong with this class addition to this rails form_for?
body: <p>I am trying to style form elements within this rails form_for but continually run into syntax error, nothing i try seems to be working, can you see the problem?</p>
  
  <pre><code>&lt;%= form_for(@todo_list) do |f| %&gt;
    &lt;div class="form-group"&gt;
      &lt;%= f.label :title %&gt;&lt;br&gt;
      &lt;%= f.text_field :title %&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;%= f.label :description %&gt;&lt;br&gt;
      &lt;%= f.text_area :description %&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;%= f.submit, html: {class: "btn btn-default btn-xs"} %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Results in this error: <code>_form.html.erb:23: syntax error, unexpected tLABEL, expecting '=' ...buffer.append=( f.submit, html: {class: "btn btn-default btn... ...</code></p>
  
  <p>All sorts of variations of <code>class=</code>, <code>class:</code>, <code>html=&gt;</code>, etc etc just seem to give errors too. </p>
  
  <p><code>&lt;%= f.submit, class: "btn btn-default btn-xs" %&gt;</code></p>
  
  <p>results in this error:</p>
  
  <p><code>SyntaxError in TodoListsController#edit ...... _form.html.erb:23: syntax error,unexpected tLABEL, expecting '=' ...uffer.append=( f.submit, class: "btn btn-default btn-xs" );@... ... ^</code></p>
  
  <p>Passing 'form-horizontal' into <code>form_for</code> still produces an error;</p>
  
  <pre><code>&lt;%= form_for(@todo_list, html =&gt; {:class =&gt; "form-horizontal"})  do |f| %&gt;
  ....
  ....
  &lt;%= f.submit, class: "btn btn-default btn-xs" %&gt;
  </code></pre>
  
  <p><code>SyntaxError in TodoListsController#edit ... _form.html.erb:23: syntax error, unexpected tLABEL, expecting '=' ...uffer.append=( f.submit, class: "btn btn-default btn-xs" );@... ... ^</code></p>
  
  <p>Note that if i explicitly declare a label to the submit action, e.g.;</p>
  
  <pre><code>&lt;%= f.submit 'Save', class: "btn btn-default btn-xs" %&gt;
  </code></pre>
  
  <p>Then the class gets added successfully and my bootstrap styling works. However this neither locates the primary problem nor solves it as then I can't use rails' form_for dynamic naming of the submit action.</p>
  
  <p>Classes I apply to divs seem to work fine, bootstrap is loaded fine. Can anyone help? Thanks</p>