title: Backbone. Model attributes gets undefined on Model.save();
body: <p>Im trying to save a model after my attributes gets set. But when i look in the console i see that all attributes gets undefined. Anyone here that can help me on this?</p>
  
  <p>This is my model:</p>
  
  <pre><code>PostModel = Backbone.Model.extend({ 
  
  url: "api/?action=answerQuestion&amp;question_id="+this.questionId+"&amp;option_id="+this.optionId+"&amp;type="+this.role,
  
  defaults: {
      questionId: 0,
      optionId: 0,
      role: 0
  },
  
  initialize: function(){
  
  }
  </code></pre>
  
  <p>});</p>
  
  <p>And here is the function where i want to save/post it.</p>
  
  <pre><code>        answerQuestion: function(event) {
      event.preventDefault();
      $('li').each(function(e) {
          $(this).addClass('inactive');
      });
      $(event.currentTarget).removeClass('inactive').addClass('active');
  
      var currentQuestion = 1;
      var answer = parseInt($(event.currentTarget).find('a').attr('data-answer'));
      var role = 1;
  
      var postModel = new PostModel();
      postModel.set({ 
          questionId: currentQuestion, 
          optionId: answer, 
          role: role
      });
  
      postModel.save();
  }
  </code></pre>