-1

I have 7 models of login after using devise name as

1- super admin 2- admin 3- branch 4- faculty 5- student 6- parent 7- user

I want to follow a process where a super admin should have an authority to go to signup and create admin account and a admin should have authority to create branch and faculty account using signup link of branch and faculty. and super admin, admin, branch and faculty having create account of student and parent. and in user model any one can signup.

I removed a super admin signup link after creating a super admin account through changes in super admin model `

before

 devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable`

after

devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable

notice :registerable has been removed form above. using this i authenticate a super admin model only one super admin account created.

to authenticate admin model as a super admin can create this account i need a session of a super admin account and need to try this

before_filter :authenticate_admin!, only: [:new, :create]

in sign up controller as usual we do in all other application. But here is the problem I am not able to find controller file of these as someone told about this there is no controller file so kindly help in the reference to go right to solve the problem.

1 Answers1

0

If I understand what you're asking correctly, you either need to opt to override a method on the Devise controller, or change the Devise source code. Here's a good link to help you learn how to override Devise's existing functionality. Be sure to update your devise_for scopes to reflect the new controller addition.

If you want to go in and physically change the ACTUAL Devise Controller, you'll have to pull it down from source code and include it in your application. These sorts of questions get asked quite a bit, so there are lots of links elsewhere on Stack Overflow.

Hope this helps!

Community
  • 1
  • 1
Collin Graves
  • 2,207
  • 15
  • 11
  • I m not getting success what i want after follow your suggestion i refer your suggested link and tried same as mention but there is nothing to happen as I was expecting. I created a custom controller i have given the name of controller which is registration and setup the root and used devise for :controller=>{:registration=>"registration"} after devise_for :students and in my controller file i used before_filter :authenticate_admin!, :only[:new, :create] There is no error but student signup link opens as well . – Prashant Ravi Darshan Mar 07 '15 at 11:10