How to add a username to devise in Rails

Using a username instead of an email for login is a very common thing to have in web apps. In this episode, I show you how to add a username field to the user model, then update devise so it works. Finally, I walk through a rspec spec to show it works.
🤯 Support on Patreon
  • https://www.patreon.com/davidwparker

⏱️ Timestamps:
  • 00:00 - Introduction
  • 00:30 - Readme
  • 01:28 - devise config
  • 01:40 - applicationcontroller.rb changes
  • 02:00 - user.rb changes
  • 04:25 - new route for user availability
  • 04:50 - controller code
  • 05:25 - user request spec

💌 Newsletter:
  • https://www.programmingtil.com/

🪐Elsewhere:
  • Twitter: https://twitte r.com/davidwparker
  • Twitter: https://twitter.com/programmingtil
  • GitHub: https://github.com/davidwparker

💭Concepts:
  • Adding username field to devise.

📚Resources:
  • https://github.com/davidwparker/programmingtil-rails/tree/ep12

🎬 Subscribe!
  • http://bit.ly/subdavidwparker

My name is David W Parker and I’m creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. I’m a huge fan of Ruby on Rails, Svelte, TailwindCSS, and WebGL. I’ve used React a lot in the past, as well as some Vue and AngularJS. I’ve done some professional Python and Django. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.

ruby #rails #rubyonrails

© programmingtil.com