From 3578c13abd86d15ca6310bf5652f4855a8daa1a8 Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 25 Jul 2013 11:21:27 -0700 Subject: Have navigation link to new customer form if user is not already a braintree customer. --- billing/app/helpers/billing_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'billing/app/helpers') diff --git a/billing/app/helpers/billing_helper.rb b/billing/app/helpers/billing_helper.rb index f91d9c9..7ec9285 100644 --- a/billing/app/helpers/billing_helper.rb +++ b/billing/app/helpers/billing_helper.rb @@ -9,4 +9,12 @@ module BillingHelper form_for object, options, &block end + def show_or_new_customer_link(user) + if (customer = Customer.find_by_user_id(user.id)) and customer.has_payment_info? + show_customer_path(user) + else + new_customer_path + end + end + end -- cgit v1.2.3