search for: admin_employee

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

2012 Dec 03
2
Stop User from Changing URL
...ct_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 access this page." If you change the url to any other pa...