I still had to do some modifications so this actually is the final
version:


def do_new
    @params_id = params[:id]
    if @params_id.present?
      @record = NotApprovedOrder.find(@params_id).clone
      @record.quantity = nil
      @record.is_approved = 0
      @record.is_delivered = 0
      @record.has_sufficient_funds = 0
      @record.csir_po_number = ''
    else
      @record = Order.new
    end

  end

  def before_create_save(record)
    record.user_id = @current_user.id
    record.created_at = Time.now
  end

Cheers Juergen

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to