title: Multiple Models in Devise
body: <p>I'm trying to create multiple models in Devise (using Ruby 2.0, Rails 4).  I have searched Stack Overflow and tried Google, but most people end up using inheritance or CanCan.</p>
  
  <p>The problem is that I need two entirely different models to be able to sign up and use my website, in two entirely different ways - one uses email or username to log in, and has all sorts of management abilities (such as seeing graphs of MobileUser usage, etc).  The other will only access from a mobile device, uses a phone number to log in, and has a much simpler interface.</p>
  
  <p>I tried to run Devise for both ('rails g devise WebUser' and 'rails g devise MobileUser').  I now have tables and columns for both, but only have routes and a model for the WebUser. I tried manually adding routes and a model for the MobileUser, but nothing works - the model doesn't connect to the table, the routes produce runtime errors ('WebUser does not respond to 'devise' method).</p>
  
  <p>Everything I've read indicates that I <em>can</em> get Devise to work for two models on my one website - how do I implement this?</p>
  
  <p>My routes:</p>
  
  <pre><code>Mailer::Application.routes.draw do
    devise_for :web_users
    # devise_for :mobile_users (doesn't work, so it is commented out)
  
    resources 'web_users', only: [:show, :index]
    resources 'mobile_users', only: [:show, :index]
  
    root 'static_pages#home'
  
    match '/contact',  to: 'static_pages#contact',  via: 'get'
    match '/faq',      to: 'static_pages#faq',      via: 'get'
  end
  </code></pre>