I'm using devise and cancan as an authentication solution.
For devise I have added a role attribute, and created a constant ROLES:
#Migration for adding roles
class AddRoleToUsers < ActiveRecord::Migration
def change
add_column :users, :role, :string
end
end
#Users.rb
ROLES = %w[user staff]
I want to add a function to the signup page, such that for a person to create a user with the role "staff" he has to enter a secret key as well (probably like a secret code like "staffsecretkey" in a input text box)
Anyone know of a way?
Thanks in advance.