search for: current_employee

Displaying 1 result from an estimated 1 matches for "current_employee".

Did you mean: current_employer
2012 Dec 03
2
Stop User from Changing URL
...nless signed_in? store_location redirect_to signin_path, notice: "Please sign in to access this page." end end def correct_employee @employee = Employee.find(params[:id]) redirect_to(root_path) unless current_employee? (@employee) end def admin_employee redirect_to(root_path) unless current_employee.admin? end end The pages start out at root. If you try and change the url to say ''employees'' you will get the message "Please sign in to...