mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Extract boilerplate code
This commit is contained in:
@@ -28,13 +28,17 @@ class SplitCheckoutController < ::BaseController
|
||||
flash.now[:error] = I18n.t('split_checkout.errors.global')
|
||||
|
||||
render operations: cable_car.replace(
|
||||
selector: "#checkout", html: render_to_string(partial: "split_checkout/checkout", formats: [:html])
|
||||
"#checkout", partial("split_checkout/checkout")
|
||||
), status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def partial(path, options = {})
|
||||
{ html: render_to_string(partial: path, **options) }
|
||||
end
|
||||
|
||||
def clear_invalid_payments
|
||||
@order.payments.with_state(:invalid).delete_all
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user