title: cakephp: add and edit in single view
body: <p>i am working in cakephp n am new to it. I have created a view to add data into database. I wish to edit the record- when user clicks on edit, the same add view should appear filled with the added data.
  My problem is that i have foreign keys in the table and when i click on edit, the textbox gets filled with foreign key id instead of text stored in that id. And also i have used some jquery in add view for some fields. So while editing those fields aren't displayed at all. Following is the code:</p>
  
  <pre><code>public function ride_offer($id = NULL) {
  
           if (empty($this-&gt;data)) {
  
          $this-&gt;data = $this-&gt;Rideoffer-&gt;read(null, $id);
        // debug($this-&gt;data); die;
      }
  
  }
  </code></pre>
  
  <p><code>ride_offer</code> is the add view- i wish to open the same in edit refilled with the added data.</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;text('Rideoffer.DropAt', 
                                              array('class' =&gt; 'address-text',
                                                 ));  ?&gt;
  </code></pre>
  
  <p>just an example- Rideoffer.DropAt shows id instead of actual address stored in Place table . Rideoffer table stores reference of Place as DropAt.</p>
  
  <p>How do i solve this?</p>