title: simple ajax form in cakephp 3.0
body: <p>As JsHelper is no more in cakephp 3.0 so what i am doing is to save my form data into database using ajax
  <br>
  <hr>
  i just have two input fields.<br>
  my files are:</p>
  
  <hr>
  
  <ol>
  <li>add.ctp</li>
  <li>js.js</li>
  <li>EmployeesController.php</li>
  </ol>
  
  <p><hr>
  <strong>add.ctp</strong>
  <br></p>
  
  <pre>
  
      $this->Form->create('Employees');
          $this->Form->input('name', array('id'=>'name'));
          $this->Form->input('age', array('id'=>'age'));
          $this->Form->button('Add Info', array(
                 'type'=>'button',
                 'onclick'=>'infoAdd();'
          ));
      $this->Form->end();
  </pre>
  
  <p><strong>js.js</strong></p>
  
  <pre>
  
      function infoAdd() {
          var name=$("#name").val();
          var age=$("#age").val();
          $.get('/employees/info?name='+name+"&age="+age, function(d) {
              alert(d);
          });
      }
  
  </pre>
  
  <p><strong>EmployeesController.php</strong></p>
  
  <pre><code>class EmployeesController extends AppController {
      public $components=array('RequestHandler');
      public function add() {
          $emp=$this-&gt;Employees-&gt;newEntity();
          if($this-&gt;request-&gt;is('ajax')) {
              $this-&gt;autoRender=false;
              $this-&gt;request-&gt;data['name']=$this-&gt;request-&gt;query['name'];
              $this-&gt;request-&gt;data['age']=$this-&gt;request-&gt;query['age'];
              $emp=$this-&gt;Employees-&gt;patchEntity($emp,$this-&gt;request-&gt;data);
              if($result=$this-&gt;Employees-&gt;save($emp)) {
                  echo "Success: data saved";
                  //echo $result-&gt;id;
              }
              else {
                  echo "Error: some error";
                  //print_r($emp);
              }
          }
      }
  }
  </code></pre>
  
  <p><hr>
  <strong>Note :</strong> my model only have <code>not empty</code> rule for both fields<br><br>
  all what i am doing is working fine but i dont think i m doing it in right way or as it should be.<br>
  please help me what i m missing and what i don't need to do.</p>