你好我已經包含在我看來無法張貼在軌道上
= form_for @order, :url => update_express_shipping_path,:remote=> true, :html => { :id => "shippingDetails" } do |form|
= form.radio_button :express_shipping, true, :value => true, :id => 'shipping_method4', :name => 'shipping_method'
Express Shipping
.checkOrder{:value=> @order.id}
,並在我的js文件中給出的代碼inlcuded
$('#shipping_method4').click(function(){
if($(this).is(':checked')){
alert ('123')
$.ajax({
url: '/update_express_shipping',
type: 'POST',
data: {
'id': $('.checkOrder').attr('value'),
'express_shipping': $(this).val()
},
contentType: 'json'
});
}
})
,並在我的控制器
def update_express_shipping
byebug
a = '123'
end
現在,當我單擊單選按鈕,它被選中,所以我沒有收到我的控制器中的數據,它只給出了這個 params {「controller」=>「spree/checkout」,「action」=>「update_express_shipping」}
請讓我知道我錯在哪裏。提前致謝。
以下語法,你可以請把日誌 –