I am working on Mongoid and Rails4 I have model structure (STI) like this,
Class User
devise :database_authenticatable, :registerable
end
User Class is having devise functionality
class Teacher < User
end
class Student < User
end
In route.rb,
devise_for :users
devise_for :teachers, :skip => :sessions
devise_for :students, :skip => :sessions
In a student_profile controller i have defined,
before_filter :authenticate_student!
After signed in as "student" if i clicks on student_profiles_path its redirecting to root file. In database user type is storing as "type" : "Student", while sign up i am passing the _type value via collectionselect.
Is there any setting or code stuff i have to do...!!!