title: edit post is not working in cakephp
body: <p>I am learning Cakephp framwork. I am having problem while I am trying to update database record.</p>
  
  <p>This is Controller code for edit post.... </p>
  
  <pre><code>$this-&gt;loadModel('Post');
              if($this-&gt;request-&gt;is('put')):
              $this-&gt;Post-&gt;id = $this-&gt;params['id'];
              if($this-&gt;Post-&gt;save($this-&gt;request-&gt;data)):
                  $this-&gt;Session-&gt;setFlash(__('Page has been edited'));
                      $this-&gt;redirect('/User/index');
                  endif;
              else:
              $this-&gt;set('postinfo', $this-&gt;Post-&gt;findById($this-&gt;params['id']));
              endif;
          }
  </code></pre>
  
  <p>This is view/edit.ctp file </p>
  
  <pre><code>echo $this-&gt;Form-&gt;update('Post', array(
      'method' =&gt; 'put'
      ));
      echo $this-&gt;Form-&gt;input('title',array('type' =&gt; 'text','value'=&gt;$postinfo['Post']['title']));
      echo $this-&gt;Form-&gt;input('body', array('type' =&gt; 'textarea','value' =&gt; $postinfo['Post']['body']));
      echo $this-&gt;Form-&gt;submit('Submit', array('class'=&gt;'btn btn-primary'));
      echo $this-&gt;Form-&gt;end();
  </code></pre>
  
  <p>But this code does not update record in database...I tried everything from book.cakephp.org tutorial and other tutorials related to cakephp..
  I hope I'll get some help from you guys :)</p>