I am currently working on a backbone application, where you have to specify a guest name, in order to enter.
  Guest = Backbone.Model.extend({
    urlRoot : ftd.settings.rest + '/guest',
    defaults: {
      name : '',
    },
    validate: function( attr ) {
      var errors = [];
      if(attr.name.length < 4) {
        errors.push({message : "You nickname, must be atleast 4 chars", name : 'guestNickname'});
      }
      if(errors.length > 0) {
        return errors;
      }
    }
  });
  return Guest;
So on my frontpage the user sets a username and a new guest is instantiated, this is my front page view that handles the guest creation.
createGuest: function( ev ) {
  ev.preventDefault();
  // Get nickname.
  var guest = new Guest();
  guest.bind( 'error', function( model, errors ) {
        _.each( errors, function( err ) {
      $('input[name=' + err.name + ']').addClass('invalid');
      // add a meesage somewhere, using err.message
          }, this );
  });
  guest.save({'name' : $('input[name="guestNickname"]').val()}, {
    success:function(model, response) {
      console.log('Successfully saved!');
    },
    error: function(model, error) {
      console.log(model);
      console.log(error.error());
    }
  });
},
My problem is that, when backbone makes the request, it sends a OPTIONS request without the specified name, i even checked the packet in Wireshark, what am i doing wrong?
Bonus question: Why is backbone sending a OPTIONS request?
 
    