title: Nesting Ruby on Rails HAML Checkbox in Label Tag
body: <p>I have the following code which doesn't work:</p>
  
  <pre><code>= form_for(resource, :as =&gt; resource_name, :url =&gt; session_path(resource_name), :html =&gt; { :class =&gt; "well" }) do |f|
  
  = f.label :email
  = f.email_field :email
  
  = f.label :password
  = f.password_field :password
  - if devise_mapping.rememberable?
   %p
    = f.label :remember_me, :class =&gt; "checkbox" 
      = f.check_box :remember_me, :class =&gt; "checkbox"
  
    %div= f.submit "Einloggen"
  = render :partial =&gt; "devise/shared/links"
  </code></pre>
  
  <p>It only works in that way, but I need it in one line and not in wto:</p>
  
  <pre><code>%p
    = f.label :remember_me, :class =&gt; "checkbox" 
    = f.check_box :remember_me, :class =&gt; "checkbox"
  </code></pre>
  
  <p>Please help! I'm really desprate right now. I just want the checkbox nested in the label for the bootsrap form. I searched google and stackoverflow but found nothing</p>
  
  <p>UPDATE:</p>
  
  <p>I solved it now like this:</p>
  
  <pre><code>- if devise_mapping.rememberable?
  %p
    %label.checkbox{ :for =&gt; "remember_me" }
      = f.check_box :remember_me, :class =&gt; "checkbox"
      Remember 
  </code></pre>