<script> var depart_date='11 February 2013';
var depart_date='21 February 2013';
</script>
jQuery.ajax({
data: { depart: depart_date, return_date: return_date},
type: 'post',
url: "/payment/create",
});这是我的ajax调用。
在终端中,它的值为{"depart"=>"11 Feumer2013“,"return_date"=>"21 Feumer2013”}
但在控制器params:depart & params:return中,显示为nil值。
我哪里做错了,一个人能帮我吗?
发布于 2013-02-12 19:44:38
将ajax更改为以下内容
jQuery.ajax({
url: "/payment/create", // you to pass this as the url option
type: 'post',
data: 'depart=' + depart_date,
dataType: 'script', // this should be dataType, not dateType
success: function() { alert('success') } // this should be a function
});https://stackoverflow.com/questions/14830618
复制相似问题