Chapter 6. Authentication
This chapter covers
- Adding authentication to an application
- Using the Devise gem
- More associations, linking tickets to users
You’ve created two resources for your Ticketee application: projects and tickets. Now you’ll add authentication to let users sign in to your application. With this feature, you can track which tickets were created by which users. A little later, you’ll use these user records to allow and deny access to certain parts of the application. To round out the chapter, you’ll create another CRUD interface, this time for the users resource, but with a twist.
The general idea behind having users for this application is that some users are in charge of creating projects (project owners), and others use whatever the projects provide. If they find something wrong with a project or wish to suggest an improvement, filing a ticket is a great way to inform the project owner about their request. To round out the chapter, we’ll link tickets to the users who created them. This way, anyone viewing a ticket can know exactly who created it, rather than it just being yet another ticket in the application.