class Wco::InvoicesController
def update
def update @invoice = Wco::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