Class: Workarea::Admin::PaymentGiftCardsController
- Inherits:
-
Admin::ApplicationController
- Object
- Admin::ApplicationController
- Workarea::Admin::PaymentGiftCardsController
- Defined in:
- app/controllers/workarea/admin/payment_gift_cards_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #redemptions ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
25 |
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 25 def edit; end |
#index ⇒ Object
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, ) end |
#new ⇒ Object
14 |
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 14 def new; end |
#redemptions ⇒ Object
42 43 |
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 42 def redemptions end |
#show ⇒ Object
12 |
# File 'app/controllers/workarea/admin/payment_gift_cards_controller.rb', line 12 def show; end |
#update ⇒ Object
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 |