Class: PaymentsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/payments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/payments_controller.rb', line 12

def create
  @payment = Payment.new(params[:payment])
  if @payment.save
    flash[:notice] = "Payment created"
    redirect_to :controller => 'invoice', :action => "show", :id => params[:id], :invoice => { :id => @payment.invoice }
  else
    render :action => 'new', :id => params[:id]
  end    
    
end

#newObject



8
9
10
# File 'app/controllers/payments_controller.rb', line 8

def new
  @payment = Payment.new(payment_params)
end