Class: Trade::Admin::PaymentReferencesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/trade/admin/payment_references_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 19

def create
  @payment_reference = @payment_method.payment_references.build(payment_reference_params)

  if @payment_reference.save
    redirect_to admin_payment_methods_url
  else
    render :new
  end
end

#destroyObject



37
38
39
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 37

def destroy
  @payment_reference.destroy
end

#editObject



16
17
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 16

def edit
end

#indexObject



5
6
7
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 5

def index
  @payment_references = PaymentReference.all
end

#newObject



12
13
14
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 12

def new
  @payment_reference = @payment_method.payment_references.build
end

#showObject



9
10
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 9

def show
end

#updateObject



29
30
31
32
33
34
35
# File 'app/controllers/trade/admin/payment_references_controller.rb', line 29

def update
  if @payment_reference.update(payment_reference_params)
    redirect_to @payment_reference
  else
    render :edit
  end
end