0

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...!!!

RubyOnRails
  • 235
  • 1
  • 15
  • what do you have in session? is there _warden_user? _warden_student? you may need to store it explicitly as `sign_in :student, user if user` or something like that – faron Dec 03 '13 at 16:59
  • @faron I am not using any kind of warden_user? It's simple devise authentication. Can you elaborate on this!!! – RubyOnRails Dec 05 '13 at 06:09

0 Answers0