app/controllers/invoices_controller.rb
#
# Creates new invoice.
# This action is usually called from form created by +new+ action
# 
Creates new invoice.
This action is usually called from form created by +new+ action
Creates new invoice . This action is usually called from form created by + new + action
def create
    @invoice = Invoice.new(params[:invoice])
    @invoice.user_id = @current_user.id
    @invoice.created_at = Time.now
    if @invoice.save
      flash[:notice] = 'Invoice was successfully created.'
      redirect_to :action => 'list'
    else
      render :action => 'new'
    end
  end
def create @invoice = Invoice . new ( params [ :invoice ] ) @invoice . user_id = @current_user . id @invoice . created_at = Time . now if @invoice . save flash [ :notice ] = 'Invoice was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end
Creates new invoice.
Creates new invoice .