Skip to content

Instantly share code, notes, and snippets.

@bishopandco
Created August 18, 2010 19:11
Show Gist options
  • Save bishopandco/535825 to your computer and use it in GitHub Desktop.
Save bishopandco/535825 to your computer and use it in GitHub Desktop.
@tn = params[:tn][:tracking_number]
@tns = @tn.split(',')
if @tns.count >= 2
@tns.each do |tn|
@tracking_number = TrackingNumber.new
@tracking_number.tracking_number = tn
@tracking_number.order_id = @order.id
@tracking_number.save
count +=1
end
else
@tracking_number = TrackingNumber.new
@tracking_number.tracking_number = params[:tn][:tracking_number]
@tracking_number.order_id = @order.id
@tracking_number.save
count +=1
end
@bishopandco
Copy link
Author

@tn = params[:tn][:tracking_number]
@tn.split(',').each do |tn|
  @tracking_number = TrackingNumber.new
  @tracking_number.tracking_number = tn
  @tracking_number.order_id = @order.id
  @tracking_number.save
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment