This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
card_saver = Billing::SaveCreditCard.new(user: current_user, card: card_params) | |
responder = respond do |r| | |
r.success { render :success } | |
r.failure { render :failure } | |
end | |
card_saver.call(responder) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreditCardController < ApplicationController | |
def create | |
respond_with CreditCardCreator.new(params) | |
end | |
end | |
class Grouper::Responder | |
delegate :errors, to: :resource | |
def resource |