title: Saving User and Detail rows with Cake 2.4.5
body: <p>I am very new to cake and I was wondering how i would be able to create a new user and also be able to create the contact details</p>
  
  <p>database is like so</p>
  
  <p>Users</p>
  
  <ul>
  <li>user_id</li>
  <li>contact_detail_id</li>
  <li>password</li>
  <li>role_id</li>
  <li>username</li>
  </ul>
  
  <p>Contact_Details</p>
  
  <ul>
  <li>contact_detail_id</li>
  <li>address1</li>
  <li>address2</li>
  </ul>
  
  <p>and many other fields</p>
  
  <p>In the User model I have assigned public $hasOne = array('ContactDetail');</p>
  
  <p>Since the user will have one contactdetail</p>
  
  <p>Now what I need to know is how would this would be saved in the add method as many said to use the saveassociated although this doesn't seem to be working.</p>
  
  <p>The add view is like so and from my understanding this is correct</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;create('User', array('action' =&gt; 'add')); ?&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;?php echo __('Add User'); ?&gt;&lt;/legend&gt;
      &lt;?php
          echo $this-&gt;Form-&gt;input('User.username');
                  echo $this-&gt;Form-&gt;input('User.password');
                  echo $this-&gt;Form-&gt;input('roles');
  
                  echo $this-&gt;Form-&gt;input('ContactDetail.name');
                  echo $this-&gt;Form-&gt;input('ContactDetail.surname');
                  echo $this-&gt;Form-&gt;input('ContactDetail.address1');
                  echo $this-&gt;Form-&gt;input('ContactDetail.address2');
                  echo $this-&gt;Form-&gt;input('ContactDetail.country');
                  echo $this-&gt;Form-&gt;input('ContactDetail.email');
                  echo $this-&gt;Form-&gt;input('ContactDetail.fax');
  
  
            ?&gt;      
                  &lt;label&gt;Are you interested in buying property in Malta?&lt;/label&gt;
            &lt;?php  
                  $interest_buy = array('0'=&gt;'no','1' =&gt; 'yes');
                  echo $this-&gt;Form-&gt;input('ContactDetail.interest_buy_property',array('type'=&gt;'radio','options'=&gt;$interest_buy,'value'=&gt;'0','legend'=&gt;FALSE));
            ?&gt;      
                  &lt;label&gt;Are you interested in renting property in Malta?&lt;/label&gt;
            &lt;?php  
                  $interest_rent = array('0'=&gt;'no','1' =&gt; 'yes');
                  echo $this-&gt;Form-&gt;input('ContactDetail.interest_rent_property',array('type'=&gt;'radio','options'=&gt;$interest_rent,'value'=&gt;'0','legend'=&gt;FALSE));
                  echo $this-&gt;Form-&gt;input('ContactDetail.mobile');
                  echo $this-&gt;Form-&gt;input('ContactDetail.phone');
                  echo $this-&gt;Form-&gt;input('ContactDetail.postcode');
                  echo $this-&gt;Form-&gt;input('ContactDetail.town');
  
                  echo $this-&gt;Form-&gt;input('ContactDetail.newsletter',array('type'=&gt;'checkbox','label'=&gt;'Would you like to register for the newsletter?' ,'checked'=&gt;'1','legend'=&gt;FALSE,));
           ?&gt;       
  
      &lt;/fieldset&gt;
  &lt;?php echo $this-&gt;Form-&gt;end(__('Submit')); ?&gt;
  </code></pre>