还显示了其中receive_by_admin为True的订单链接。
if order.payment_status == 'Paid' && order.received_by_admin != 'true'
link_to "Payment Received", "orders/#{order.id}/?payment_status=Paid", class: "member_link", method: :put
end
答案 0 :(得分:2)
可能是因为received_by_admin
是布尔值吗?所以
order.payment_status == 'Paid' && order.received_by_admin != true
或更简单
order.payment_status == 'Paid' && !order.received_by_admin
这里的重点是true != 'true'