vendredi 29 mai 2020

Access routes in ruby after logged in

I am beginner in ruby. I have routes in routes.rb like: get 'users/edit/:id'. I made a login route as well.

I want to check if someone is logged in before he access a route, so if we try to access get 'users/edit/:id' without logged in we will redirect to the login screen.

How can i do that? I think I should write something after the routes to check if the user is logged in, but i dont know the syntax. Thx for the answers

Aucun commentaire:

Enregistrer un commentaire