SOLVED: Problem with tutorial cakephp 2

Greetings, I’m trying cakephp 2, following the Tuto, the crud works, but when editing a post, this does not save the edit and generates an error:

Error: The requested address ‘/cakephp2/posts/edit’ was not found on this server.

I appreciate your help.


change key ‘action’ by ‘id’ in view/edit

amigo el edit recibe como parametro un id. ese error esta haciendo referencia a la dirección ya que no se le esta pasando un id como parametro. otra cosa. te respondi esto en español pero trata de hacer todas las preguntas en ingles para que la comunidad te pueda ayudar!!! saludos.

What helped me is the debug mode. It tells me exactly what doesn’t work, in relation to the detailed path that is followed.
In /config, file “app.php”, apply this line (line 12 in my file);
‘debug’ => filter_var(env(‘DEBUG’, true), FILTER_VALIDATE_BOOLEAN),
Then you might see whether there is something wrong with the PostController or the edit.ctp file for instance.

Ok thanks, change in the view edit the word URL by action and works, but every time I do an edit I get the following:

Deprecated (16384): Using key action is deprecated, use url directly instead. [CORE\Cake\View\Helper\FormHelper.php, line 383]

Use this line of code to see what is sending you as a parameter
<? php debug($controller); ?> being $controller the variable that receives in the view through a set from the controller, that way you can verify if you are sending the data correctly and from there you can work on a solution. :slightly_smiling_face:


Thanks por your help. need read more about this framework.