You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't really an "ISSUE" but I figured this would be the best way to push this info out to everyone...
If you want to incorporate the logged in user (current_user) into any logic:
1.) Within a view or a controller, you can call the function signed_in?, which will return true or false if the user is signed in or not. You can use this to toggle parts of an html page, for example.
2.) If the user is logged in (by 1.) ), then, within a controller or view, you can get info about the user using the user object current_user.
A user object has a name, a first_name, a last_name, and a andrew_id
3.) current_user.can_moderate? returns true if the user is the moderator
The text was updated successfully, but these errors were encountered:
This isn't really an "ISSUE" but I figured this would be the best way to push this info out to everyone...
If you want to incorporate the logged in user (current_user) into any logic:
1.) Within a view or a controller, you can call the function signed_in?, which will return true or false if the user is signed in or not. You can use this to toggle parts of an html page, for example.
2.) If the user is logged in (by 1.) ), then, within a controller or view, you can get info about the user using the user object current_user.
A user object has a name, a first_name, a last_name, and a andrew_id
3.) current_user.can_moderate? returns true if the user is the moderator
The text was updated successfully, but these errors were encountered: