hello I am new to rails and i have installed rails version 4. I would like to know that I am making project for teacher n students. Can I apply devise gem to both the models te
Devise can work for you, but you will have to run through some tutorials. Your request for a complete how-to is too broad for an Stack Overflow question. http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html#authorization
You may also want to look at a gem to manage permissions, as Devise is more for authentication. My personal favorite is the_role, but others like cancan very much.