문제

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,

도움이 되었습니까?

해결책

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

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top