title: Authentication with Devise, Rails using backbone.js
body: <p>I am new to backbone and been trying to pull off an authentication but in vain. Please help over here;</p>
  
  <p>My view looks like this;</p>
  
  <pre><code>mama.Views.UserSessionsIndex = Backbone.View.extend({
  
    template: JST['user_sessions/index'],
    render: function() {      
      this.$el.html( this.template );
      return this;
    },
    events: {
              "click #sign_in_button": "signIn"
          },  
  
    signIn: function(event) {
      var userSession = new Skymama.Models.UserSession;
      userSession.set({email: $('#email_address').val(), password: $('#password').val()});
      userSession.save({
          success: function(model, response) {
             alert("response"); 
          },
  
          error: function(model, response){
              alert("response");
          }
      });
    }
  
  });
  </code></pre>
  
  <p>However, i get this response <code>401 Unauthorized</code> for an authorised error. How can i handle these response, log in the client and redirect them. 
  Thank you</p>