customer update from doemal order

This commit is contained in:
phyusin
2018-06-05 13:28:36 +06:30
parent 13357e529f
commit 7f04c284c6
2 changed files with 15 additions and 6 deletions

View File

@@ -22,7 +22,11 @@ class OrderReservation < ApplicationRecord
else
gender = "Male"
end
customer = Customer.new
if params[:customer_id].nil?
customer = Customer.find(params[:customer_id])
else
customer = Customer.new
end
customer.name = params[:name]
customer.email = params[:email]
customer.contact_no = params[:contact_no] ? params[:contact_no] : ''