Since we learned about authenticate_user !, we will output it.
What is authenticate_user!? You can understand how to use authenticate_user !.
There are two main things you need to understand.
・ Devise method -Check if the user is logged in, and if not, redirect the user to the login page.
So how do you use it?
before_action :authenticate_user!, except: [:show, :index]
Basically used with before_action.
The meaning of the above code is Make sure the user is logged in before every action! However, if the show action and index action are called, it will be excluded. It means that · · ·
Basically, index actions and show actions can be seen in many apps even if you are not logged in. (You can see the list of tweets and the details of tweets even if you are not logged in to Twitter)