Class: Workarea::Admin::PaymentGiftCardsController

Inherits:
Admin::ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/payment_gift_cards_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 16

def create
  if @gift_card.save
    flash[:success] = 'Gift card has been created.'
    redirect_to payment_gift_card_path(@gift_card)
  else
    render :new
  end
end

#destroyObject



36
37
38
39
40
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 36

def destroy
  @gift_card.destroy
  flash[:success] = "Gift card #{@gift_card.token} has been removed."
  redirect_to payment_gift_cards_path
end

#editObject



25
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 25

def edit; end

#indexObject



7
8
9
10
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 7

def index
  search = Search::AdminGiftCards.new(params)
  @search = Admin::SearchViewModel.new(search, view_model_options)
end

#newObject



14
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 14

def new; end

#redemptionsObject



42
43
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 42

def redemptions
end

#showObject



12
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 12

def show; end

#updateObject



27
28
29
30
31
32
33
34
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 27

def update
  if @gift_card.update_attributes(gift_card_params)
    flash[:success] = 'Gift card has been saved.'
    redirect_to payment_gift_card_path(@gift_card)
  else
    render :edit
  end
end