     @actionListView.addSubView @actionListScrollView
     @actionListView.addSubView new KDButtonView
       title    : "Update Action Order"
-      callback : => @updateActionOrders()
+      callback : => @updateActionOrders domain
 
     @actionListScrollView.addSubView @actionListController.getView()
 

    ruleType   = if @ruleInput.getValue().match /[0-9+]/ then "ip" else "country"
    ruleName   = @ruleNameInput.getValue()
    ruleMatch  = @ruleInput.getValue()
    domainName = @getData().domain.domain
    delegate   = @getDelegate()

    KD.remote.api.JDomain.createProxyRule  {
      domainName, ruleInfo:{type:ruleType, match:ruleMatch}
    }, (err, response)->
      if err
        return new KDNotificationView 
          title : "An error occured while performing your action. Please try again."
          type  : "top"
      delegate.emit "newRuleCreated", {domainName:domainName, ruleName:response.Name, match:response.Match}


  viewAppended:->

    data = @getData()
    delegate = @getDelegate()

    KD.remote.api.JDomain.one {domainName:data.domainName}, (err, domain)->
      return console.log err if err
      domain.createRuleBehavior
        ruleName   : data.ruleName
        behaviorInfo :
          enabled : "yes"
          action  : behavior
          index   : "0"
      , (err, response)=>
        if not err
          delegate.emit "behaviorCreated", {domainName:data.domainName, ruleName:data.ruleName, action:behavior}

  pistachio:->
    """
