diff options
author | jessib <jessib@riseup.net> | 2013-07-25 11:21:27 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-07-25 11:21:27 -0700 |
commit | 3578c13abd86d15ca6310bf5652f4855a8daa1a8 (patch) | |
tree | 6c703e82ded7692f50c740f0ae1a9454adbed256 /billing/app/helpers | |
parent | 16128d6eb8bb8c7e467c263c3c4f79cf9869ed31 (diff) |
Have navigation link to new customer form if user is not already a braintree customer.
Diffstat (limited to 'billing/app/helpers')
-rw-r--r-- | billing/app/helpers/billing_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |