양식이 있습니다. AJAX GET 요청을 통해 유효성을 검사하려고합니다.양식 직렬화 문제
그래서 GET 요청 데이터에 필드 값을 보내려고합니다.
$('#uxMyForm').serialize();
문제가 알려지지 않은 부분을 반환하고 있습니다. 전에 serialize를 사용했습니다. 이것은 완전히 bizzare입니다.
직렬화의 반환 값은 내가 이것을 사용하는 방법을 몰라
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&customer%5BuxName%5D=&customer%5BuxEmail%5D=&customer%5BuxResidentialPhone%5D=&customer%5BuxMobilePhone%5D=&customer%5BuxDateOfBirth%5D=&customer%5BuxAddress%5D=&customer%5BuxResidentialStatus%5D=
입니다.
감사
갱신 :
내 질문에 내가 그런 요청을 처리 할 방법입니까? 이거? 내가 무엇을 관찰 할 때 내가
render :text => params
를 다음을 수행
puts params[:data][:customer][:uxName]
내 GET 요청 트리거는 작업 방식에 .. 위의 JQuery와 선이 요청을 생성이
$.get('/site/sign_up',{data : $('#uxMyForm').serialize() }, function(data){
alert(data);
});
처럼 보인다 GET, 방화범에 보내다 PARAMS
**data** authenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
내가 경고에 인쇄
반환 값은 양식 자체가 좀 어때
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
그것은'이름 1 = 값 1에서 서식을 것하는 것은, 이것이 당신이 .serialize'에서()'원하는 NAME2 = value2' 형식 ... 브라우저 (GET 요청)에서 쿼리 문자열과 동일 &, 당신의 경우 제출 코드를 게시하면 실제로 무엇을 보았는지 쉽게 알 수 있습니다. –
가 업데이트되었습니다. 친절하게 – ZX12R