I know this question has been out there many times, however I am unable to get through this.
Here is my route:
Route::post('/masters/board/edit', 'MastersController@editBoard');
My Controller:
public function editBoard() {
$board = Board::findOrFail(Input::get('id'));
$board->nick_name = Input::get('nick_name');
$board->board_name = Input::get('board');
$board->type = Input::get('type');
$board->save();
return Redirect::action('MastersController@getBoards');
}
My JS:
$("#edit_form").submit(function(e) {
e.preventDefault();
var type = "#edit_form";
var formData = {
id : $(type + " #id").val(),
nick_name : $(type + " #nick_name").val(),
name : $(type + " #board").val()
}
$.ajax({
type: "POST",
url: "masters/board/edit",
data: formData,
success: function(data) {
console.log(data);
}
});
});
});
This is throwing an error:
[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (edit, line 0)
Can anyone see a reason why?