Browse Source

Fix up patch not being supported by edit in baked controllers.

Fixes #4284
mark_story 11 years ago
parent
commit
d459aa711e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Template/Bake/default/actions/controller_actions.ctp

+ 1 - 1
src/Template/Bake/default/actions/controller_actions.ctp

@@ -102,7 +102,7 @@ $allAssociations = array_merge(
 		$<?= $singularName ?> = $this-><?= $currentModelName ?>->get($id, [
 			'contain' => [<?= $stringifyList($belongsToMany) ?>]
 		]);
-		if ($this->request->is(['post', 'put'])) {
+		if ($this->request->is(['patch', 'post', 'put'])) {
 			$<?= $singularName ?> = $this-><?= $currentModelName ?>->patchEntity($<?= $singularName ?>, $this->request->data);
 			if ($this-><?= $currentModelName; ?>->save($<?= $singularName ?>)) {
 				$this->Flash->success('The <?= strtolower($singularHumanName); ?> has been saved.');