Method: Spree::Admin::GiftCardsController#update

Defined in:
app/controllers/spree/admin/gift_cards_controller.rb

#updateObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/spree/admin/gift_cards_controller.rb', line 18

def update
  if @gift_card.update(gift_card_params)
    flash[:success] = I18n.t('spree.admin.gift_cards.gift_card_updated')
    redirect_to edit_admin_order_path(@order)
  else
    flash[:error] = @gift_card.errors.full_messages.join(', ')
    redirect_to :back
  end
end