Skip to content
Advertisement

No route found for POST … : Method Not Allowed (Allow: PUT)

Currently, I am updating the system running on the existing Symfony 2.3 (currently 3.0.9), and checking the operation.
When I tried to change the state of an item to the selected state, I got an error.
Do you have any advice for determining the case?

Error Code

No route found for "POST /admin/hq/article/3999/articleStatus": 
Method Not Allowed (Allow: PUT)

Code

ArticleController.php

    /**
     * Article status change
     *
     * @Method("PUT")
     * @Route("/article/{ids}/articleStatus")
     * @Secure(roles="ROLE_HQ_MANAGE")
     */
    public function updateArticleStatusAction(Request $request, $ids)
    {
        return parent::updateArticleStatusAction($request, $ids);
    }

Version

CentOS 6.7
PHP 5.6
Symfony3.0.9

Advertisement

Answer

I’m guessing you are using a web browser to submit a form and the action goes to /admin/hq/article/3999/articleStatus which only allows PUT operations (because of the @Method("PUT") annotation). Wheras submitting a form with a browser is a POST operation. Change that line to @Method("POST") and you should be fine.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement