8
I need to perform CRUD operations in certain locations of my application that are contained within other Formulars. For this I will use AJAX to update the views containing the "sub-content'.
I’m using the methods of Resource Controllers
of Laravel 4 to control routes from standard Framework methods:
To better illustrate the scenario: There is a register of companies that has n people assigned to this company.
The view cadastro.empresas.edit
has a form with company data and within this view I have a div that will work people being updated by AJAX according to CRUD operations.
The problem:
When I make a return Redirect::action('PessoasController@show', array('id' => $pessoa->id));
I need the requisition method to be a GET
, however as the original request (update) is a PUT
I end up falling into an infinite loop.
How do I indicate which method I want to use when calling a Redirect::action()
?
Really @Allan Freitas, for lack of knowledge insisted on waiting for Redirect. I changed the code so it works the way you suggested and it’s working. Now I just need to let it more "lean", because I am not very comfortable in leaving this kind of thing on the frontend. Anyway thank you very much!
– leirbag