Simple Rails authentication

Опубликовано: 21 Июнь 2026
на канале: Rapid Ruby
1,639
58

In this video, I show you how to make your own authentication in Ruby on Rails, from scratch. We make use of the has_secure_password module (don’t forget to enable the 'bcrypt' gem) and create a login form, logout and all of the helpers you will need for accessing the current account and prevent pages from being viewed by logged out accounts.

It’s a bit of a longer video and not very polished, let me know in the comments if you appreciate the more raw feel or not.

Chapters:
0:00 Introduction and recap from the last video
2:28 Authentication helper methods
4:40 current_account helper
4:53 Authenticating routes
6:07 Logout button
8:00 Sign-in form
11:47 Link login/register pages
13:43 Handle invalid credentials
15:50 Wrapping up...

You'll find the docs for has_secure_password here:
https://edgeapi.rubyonrails.org/class...

All of the code for this tutorial is available on GitHub:
If you want to follow along you’ll find the project at the beginning of the video on this branch:
https://github.com/phawk/coinfusion/t...
And the completed authentication example is here:
https://github.com/phawk/coinfusion/t...

---

Has this video helped you out? Consider buying me a coffee to say thanks and support future content like this, thanks!
https://app.payhere.co/rapid-ruby/buy...

You can also find more content like this, including premium courses and exclusive community and mentorship to help you level-up! Head over to https://rapidruby.com and use the code RRYOUTUBE for a discount!