title: Using Rails form helpers with Mongoid
body: <p>I'm trying to build a new Rails app with MongoDB using Mongoid as the ORM. The authentication is handled by the sorcery gem.</p>
  
  <p>I'm getting the following error in my Users#new view.</p>
  
  <p><code>undefined method 'password_confirmation' for #&lt;User:0x007feff2a23890&gt;</code></p>
  
  <p>My model looks like this.</p>
  
  <pre><code>class User                                                                                                                                                              
   include Mongoid::Document                                                                                                                                             
   authenticates_with_sorcery!                                                                                                                                           
  
   attr_accessible :username, :email, :password, :password_confirmation                                                                                                  
  
   field :username                                                                                                                                                       
   field :email                                                                                                                                                          
   field :password                                                                                                                                                       
  end
  </code></pre>
  
  <p>I get this error if I don't have a <code>field</code> definition in the model for each field. The <code>password_confirmation</code> field is a virtual field, so it shouldn't have a <code>field</code> definition anyway. How do I use dynamic and virtual fields in Mongoid (which are set to true in the config) with form helpers?</p>