Okechi Onyeje c0564fff14 Added Dashboard Integration and Authentication
- Signin and Signup views still not being shown and defaulting to default
2017-01-20 00:51:06 -05:00

24 lines
558 B
Ruby

class RegistrationsController < Devise::RegistrationsController
include ApplicationHelper
#protected
def create
binding.pry
@user = User.new(sign_up_params)
if !@user.admin?
#search by company token given by one of pearlception admins to the company
#and look up comany_id #
@user.company_id = 0
else
@user.company_id = -1
end
@user.save
sign_in @user
redirect_to "/"
end
def sign_up_params
params.require(:user).permit(:email, :password, :password_confirmation, :company_id)
end
end