I have BlocksController and Block model. In cakephp-1.2 I used edit action to edit my application's blocks and it worked fine.
After migration to 1.3 and 2.x I noticed that the edit action leads to saving an edited block as a new record.
In the cakePHP docs I read that in 1.3 the form's helper does not supply the id any more and so the model regarded the process as add.
To solve this issue, I tried to add a hidden field named id with a value of the id of the block is being edited as follows:
<?php echo $this->Form->create('Block', array('class' => 'nice custom'));?>
//The following line is required in cakephp 1.3+
<?php echo $this->Form->hidden('id', array('value' => $block['Block']['id']));?>
The described solution is working fine. However I need to know another way to do that without changing in the view. Does it possible?