0
내 .html.erb 코드이 있습니다라우팅 오류
$.ajax({
url: "/timeMachineEdit",
data: {editTimeMachine: newArray},
type: 'POST',
success: function (res) {
if (res.result === 'ok') {
alert('Data saved');
} else {
alert('Save error');
}
},
error: function() {
alert('Save error.');
}
});
이 내 datasets_controller.rb
def timeMachineEdit
@dataset = current_user.dataset
@dataset.machine_time = params[:editTimeMachine]
end
에 그리고 내 routes.rb에서 :
match "/timeMachineEdit", to: "datasets#timeMachineEdit"
그러나 submited 보여줍니다 :
POST http://localhost:3000/timeMachineEdit 500 (Internal Server Error)
여기서 문제가 있습니까? 은 ajax URL 또는 다른 경로의 경로입니까?
'일치'/ tiempoMaquinaEdit ',': tiempoMaquinaEdit는 '일치'/ timeMachineEdit ''이어야합니다. – MrYoshiji