title: RESTful login with devise (Rails 4)
body: <p>How do I do RESTful sign-up and sign-in using devise in Ruby on Rails (I am using version 4)?</p>
  
  <p>I could not find any documentation with regards to the parameters (e.g. email, password) that I should POST to the server.</p>
  
  <p>It seems that RESTful login using JSON data (e.g. via AJAX) is not supported out of the box in the current version of devise - the default behavior is to send back a whole HTML page for any type of request made, instead of a JSON object for handling JSON request specifically.</p>
  
  <p>Does this mean that I need to create/extend custom controller for handling user registration and login for RESTful apps using JSON? If so, please elaborate.</p>