Question

Good afternoon,

I'm trying to create a link to run my destroy action. Reading the documentation of Laravel 4, it should perform as follows:

link_to_action cast ('@ getIndex HomeController', $ title, $ parameters = array (), $ attributes = array ());

My code:

{{Link_to_action ('CompaniesController @ destroy', 'Test', array ($ company-> id), array ('class' => 'btn btn btn-sm-info'))}}

But when I got to the link, it redirects me to show the controller action, when the action should send me to destroy.

Thanks in advance,

Was it helpful?

Solution

In laravel -4 use this. You are following laravel 3 format:

{{ HTML::linkAction('CompaniesController@destroy', 'Test' , array ('class' => 'btn btn btn-sm-info')) }}

OTHER TIPS

that method is generate a html element, and it have not DELETE method, you need a form with DELETE method to do that

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top