I have already created a user model. I am wondering how can I customize the application with my existing user model. In doing so, I need to configure any additional routes or make atttributes available in my custom method.
While the user model
class User < ActiveRecord::Base attr_accessible :email, :pic, :name, :username has_many :topics end
My migration for CreateUsers
class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :name t.string :email t.string :username t.string :pic t.timestamps end end end
Now i plan to run
rails g migration AddDeviseColumnsToUser
And add this to my migration file
class AddDeviseColumnsToUser < ActiveRecord::Migration def change change_table :users do |t| t.string :encrypted_password, :null => false, :default => '', :limit => 128 t.confirmable t.recoverable t.rememberable t.trackable t.token_authenticatable t.timestamps end end end
Now I'm wondering how do I set up routes or do I need to? And what attributes should be available in my User model?
Update: I already installed Devise and configured it using
rails generate devise:install
psharma
source share