新来laravel,在预制项目的工作是replicatinga到另一个部分中的功能,但现在我卡住了:
Failed to load resource: the server responded with a status of 404 (Not Found) (17:26:57:137 | error, network) at http://localhost/testimonials/sort
的行动的地方作出的URL : http://localhost/ ***** /公/ index.php文件/管理/推荐
我有这样的一段JavaScript代码是被由事件称为:
sortTestimonials: function() {
$("#sortable_1, #sortable_2").sortable({connectWith: ".connectedSortable", stop: function() {
var t = [];
t = $(".connectedSortable").sortable("toArray"),
$.post("/testimonials/sort", {list: t})
}})
},
这$。员额(..)据说去我routes.php文件在那里我有控制器/段的路线
# Testimonials Routes
Route::resource('testimonials', 'AdminTestimonialsController', ['except' => ['show', 'destroy']]);
Route::post('testimonials/toggleVisibility', '[email protected]');
Route::post('testimonials/delete', '[email protected]');
Route::post('testimonials/sort', '[email protected]');
//this last one being the one it's supposed to grab
然后,我有我的控制器AdminTestimonialsController.php,我不能去(只是显示的问题明显)
public function sort() {
$order = Input::get('list');
if (Request::ajax()) {
$result = $this->testimonial->sortArticles($order);
}
return Redirect::route('admin.testimonials.index');
}
那么我在做什么错在这里,或者我错过了它的工作?
尝试在路由::资源前定义Route :: post路由 – lukasgeiter 2015-01-15 17:59:19
@lukasgeiter没有区别 – 2015-01-15 18:06:38