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