March 2025
Intermediate to advanced
472 pages
12h 10m
English
What does it mean to add login support for administrators of our store?
We need to provide a form that allows them to enter a username and password.
Once they’re logged in, we need to record that fact somehow for the rest of the session (or until they log out).
We need to restrict access to the administrative parts of the application, allowing only people who are logged in to administer the store.
We could put all of the logic into a single controller, but it makes more sense to split it into two—a session controller to support logging in and out and a controller to welcome administrators:
| | depot> bin/rails generate controller Sessions new create destroy |
| | depot> ... |
Read now
Unlock full access