Class: Spree::Api::CreditCardsController
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys
Instance Method Details
#index ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'app/controllers/spree/api/credit_cards_controller.rb', line 7
def index
@credit_cards = user
.credit_cards
.accessible_by(current_ability, :read)
.with_payment_profile
.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
respond_with(@credit_cards)
end
|
#update ⇒ Object
16
17
18
19
20
21
22
|
# File 'app/controllers/spree/api/credit_cards_controller.rb', line 16
def update
if @credit_card.update_attributes(credit_card_update_params)
respond_with(@credit_card, default_template: :show)
else
invalid_resource!(@credit_card)
end
end
|