如果删除按钮的锚点中的 href是一个获取请求,则该站点会给出No Data Received错误,如果删除,它可以正常工作,但当然删除按钮什么也不做。{{ URL::to('admin/delete', array($url->id)) }}
谁能告诉我我做错了什么?
在View.blade.php 中:
{{ Form::open(array('url' => 'admin/update', 'method' => 'post', 'files'=>true)) }}
<table>
<tr>
<td colspan="5" align="right">
<a id="$url->id" href="{{ URL::to('admin/delete', array($url->id)) }}"
onclick="return confirm('Are you sure you wish to delete?');">
<button class="delete"name="new" type="button">delete</button>
</a>
</td>
</tr>
</table>
<br />
<input class="button_green button_submit" type="submit" value="update" />
{{ Form::close() }}
在routes.php中
Route::post('/admin/update', 'UrlController@postUpdateUrl');
Route::get('/admin/delete/{id}', 'UrlController@getDeleteUrl');