diff options
author | Azul <azul@leap.se> | 2013-07-11 12:43:53 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-07-17 10:47:15 +0200 |
commit | 3a0948339984a108ada449c3a5dbbc9086a2af26 (patch) | |
tree | 666eeda8c98a0ba4b14ba78600cc40e205933106 /billing/app/helpers | |
parent | bae22682888c6e656a7c032fe819f4b662ee84ea (diff) |
billing: helper for the typical BraintreeForm
Diffstat (limited to 'billing/app/helpers')
-rw-r--r-- | billing/app/helpers/billing_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/billing/app/helpers/billing_helper.rb b/billing/app/helpers/billing_helper.rb new file mode 100644 index 0000000..f91d9c9 --- /dev/null +++ b/billing/app/helpers/billing_helper.rb @@ -0,0 +1,12 @@ +module BillingHelper + + def braintree_form_for(object, options = {}, &block) + options.reverse_merge! params: @result && @result.params[object], + errors: @result && @result.errors.for(object), + builder: BraintreeFormHelper::BraintreeFormBuilder, + url: Braintree::TransparentRedirect.url + + form_for object, options, &block + end + +end |