Browse Source

Merge pull request #4899 from berrygoudswaard/bakeDeleteAllowMethodFix

An array should be passed to allowMethod to allow multiple methods
ADmad 11 years ago
parent
commit
bf70f89fbe
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

@@ -132,7 +132,7 @@ $allAssociations = array_merge(
  */
 	public function delete($id = null) {
 		$<?= $singularName ?> = $this-><?= $currentModelName ?>->get($id);
-		$this->request->allowMethod('post', 'delete');
+		$this->request->allowMethod(['post', 'delete']);
 		if ($this-><?= $currentModelName; ?>->delete($<?= $singularName ?>)) {
 			$this->Flash->success('The <?= strtolower($singularHumanName) ?> has been deleted.');
 		} else {