title: Devise - single sign in form for multiple users
body: <p>I have two Devise models, User and Business; I would like both to be able to sign in using a single sign in form. I am using backbone js and I have a customized view so the view is not a concern. An ajax request is used for the login, it works for users as expected but not for businesses.</p>
  
  <p>I have searched google and come across a few solutions that mention using STI to solve this, but the project is very much done and I can't make such a change now. I was thinking along the lines of overriding the Devise sessions controller and:</p>
  
  <ol>
  <li>Check if the given email address is a User, then authenticate the user using Warden.</li>
  <li>If no user with that email is found then authenticate with the Business model using Warden.</li>
  </ol>
  
  <p>I can't figure out how to change the code to achieve the above, I don't know how warden works and which params I need to tweak to achieve the above, what functions need to be called. Can anyone point me in the right direction or provide an example of how should I move forward with this.</p>
  
  <p>Thanks.</p>