mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-26 04:07:40 +00:00
Added flash messages for company sign up
This commit is contained in:
parent
b1bb0f69ad
commit
7f03001238
@ -22,8 +22,19 @@ class RegistrationsController < Devise::RegistrationsController
|
|||||||
if company.company_name == "IVA"
|
if company.company_name == "IVA"
|
||||||
@user.admin = true
|
@user.admin = true
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
flash[:alert] = "The serial key provided was invalid."
|
||||||
|
redirect_to '/'
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
flash[:alert] = "A company serial key must be provided to register."
|
||||||
|
redirect_to '/'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @user == ""
|
||||||
|
flash[:alert] = "Please provide a password to register with."
|
||||||
|
redirect_to '/'
|
||||||
|
else
|
||||||
@user.save
|
@user.save
|
||||||
sign_in @user
|
sign_in @user
|
||||||
if !@user.admin
|
if !@user.admin
|
||||||
@ -32,6 +43,8 @@ class RegistrationsController < Devise::RegistrationsController
|
|||||||
redirect_to "/" and return
|
redirect_to "/" and return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
#Param checking method for creation of a new user
|
#Param checking method for creation of a new user
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user