Skip to content

Instantly share code, notes, and snippets.

View brett-richardson's full-sized avatar

Brett Richardson brett-richardson

View GitHub Profile
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
class CreditCardController < ApplicationController
def create
respond_with CreditCardCreator.new(params)
end
end
class Grouper::Responder
delegate :errors, to: :resource
def resource