<div class="content">
  <form id="newServer" style="padding: 10px;">
    <input type="text" name="host" placeholder="IP Address/Hostname" />
    <input type="text" name="label" placeholder="Label" />
    <button class="btn btn-positive btn-block" type="submit">Create new server</button>
  </form>
  <script class="load-on-push" type="text/javascript" charset="utf-8">

    $('header a.pull-right').remove();

    $('#newServer').on('submit', function(e) {
      e.preventDefault();
      var host = $('input[name="host"]').val();
      var label = $('input[name="label"]').val();

      var data = {
        host: host,
        label: label
      };

      // Ajax call to POST the new server here
      $.ajax({
        method: "POST",
        url: "/servers",
        data: {
          server: {
            label: label,
            host: host
          }
        }
      }).done(function(resp) {
        window.location.href = '/';
      });
    });

  </script>
</div>



<div class="content">
  <form id="newServer" style="padding: 10px;">
    <input type="text" name="host" placeholder="IP Address/Hostname" />
    <input type="text" name="label" placeholder="Label" />
    <button class="btn btn-positive btn-block" type="submit">Create new server</button>
  </form>
  <script class="load-on-push" type="text/javascript" charset="utf-8">

    $('header a.pull-right').remove();

    $('#newServer').on('submit', function(e) {
      e.preventDefault();
      var host = $('input[name="host"]').val();
      var label = $('input[name="label"]').val();

      var data = {
        host: host,
        label: label
      };

      // Ajax call to POST the new server here
      $.ajax({
        method: "POST",
        url: "/servers",
        data: {
          server: {
            label: label,
            host: host
          }
        }
      }).done(function(resp) {
        window.location.href = '/#servers';
      });
    });

  </script>
</div>



Return to server list after creating a new server
Return to server list after creating a new server
