Iteration I1: Authenticating Users
Building a user administration system is a common task in web applications. Rails provides a generator to help you get started. The code it generates is a good starting point, and takes care of important details like storing passwords securely. It builds upon sessions, mailers, and jobs, which we’ve seen in previous chapters.
We start by running the generator:
| | depot> bin/rails generate authentication |
This creates three models: Session, User, and Current. It creates controllers for sessions and passwords and a controller concern for authentication. Finally, it creates views for passwords and their associated mailer. The one task it leaves to you is the task of defining the user. We could create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access