Method: IshManager::InvoicesController#update

Defined in:
app/controllers/ish_manager/invoices_controller.rb

#updateObject



136
137
138
139
140
141
142
143
144
145
146
# File 'app/controllers/ish_manager/invoices_controller.rb', line 136

def update
  @invoice = Ish::Invoice.find params[:id]
  authorize! :update, @invoice
  if @invoice.update_attributes params[:invoice].permit!
    flash[:notice] = 'Success'
    redirect_to :action => 'index'
  else
    flash[:alert] = "Cannot update invoice: #{@invoice.errors.messages}"
  end
  redirect_to :action => 'index'
end