Class: Sprangular::CreditCardsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/sprangular/credit_cards_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#invalid_resource!, #not_found, #unauthorized

Instance Method Details

#destroyObject



4
5
6
7
8
9
10
11
# File 'app/controllers/sprangular/credit_cards_controller.rb', line 4

def destroy
  authorize! :update, @user

  credit_card = @user.credit_cards.find params[:id]
  @user.drop_payment_source(credit_card) if credit_card

  respond_with credit_card
end