title: how to add roles to my users in rails app?
body: <p>I have a simple app with an authentication system from devise. I tried adding roles to the user model. But nothing happens.</p>
  
  <p>what i did was
  <strong>created the Role model and link it to the User Model:</strong></p>
  
  <pre><code>$ rails g model Role name:string
  $ rails g migration addRoleIdToUser role:references
  $ rake db:migrate
  </code></pre>
  
  <p>(as directed by the devise wiki)</p>
  
  <p><strong>Then in my Models:</strong></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    belongs_to :role
  end
  class Role &lt; ActiveRecord::Base
    has_many :users
  end
  </code></pre>
  
  <p><strong>Set up seeds.rb with my roles:</strong></p>
  
  <pre><code>['seller', 'buyer', 'admin'].each do |role|
    Role.find_or_create_by({name: role})
  end
  </code></pre>
  
  <p><strong>Then</strong></p>
  
  <pre><code>$ rake db:seed
  </code></pre>
  
  <p>That's all. And I also want to know how to make the user chose any of these roles at the time of signup</p>