app/controllers/invoices_controller.rb
def update
    assert_params_must_have :id
    
    @invoice.issued_at  = Time.now if !params[:invoice].nil? && params[:invoice][:is_issued]
    @invoice.user_id    = @current_user.id

    if @invoice.update_attributes(params[:invoice])
      flash[:notice] = 'Invoice was successfully updated.'
      redirect_to :action => 'show', :id => @invoice
    else
      render :action => 'edit'
    end
    
  end
#
# Updates invoice.
# This action is usually called from form created by +edit+ action
#
Updates invoice.
This action is usually called from form created by +edit+ action
Updates invoice . This action is usually called from form created by + edit + action
def update
    assert_params_must_have :id
    @invoice.issued_at  = Time.now if !params[:invoice].nil? && params[:invoice][:is_issued]
    @invoice.user_id    = @current_user.id
    if @invoice.update_attributes(params[:invoice])
      flash[:notice] = 'Invoice was successfully updated.'
      redirect_to :action => 'show', :id => @invoice
    else
      render :action => 'edit'
    end
  end
def update assert_params_must_have :id @invoice . issued_at = Time . now if ! params [ :invoice ] . nil? && params [ :invoice ] [ :is_issued ] @invoice . user_id = @current_user . id if @invoice . update_attributes ( params [ :invoice ] ) flash [ :notice ] = 'Invoice was successfully updated.' redirect_to :action => 'show' , :id => @invoice else render :action => 'edit' end end
Updates invoice.
Updates invoice .