How to add pretty URLs in Ruby on Rails

Most of the time when you have a webapp, you probably want to have some "pretty URLs" for certain resources. For example, you may offer your users the ability to have domain.com/users/my-super-cool-url. The nice thing is, with Rails, this is incredibly easy to do with the Friendly Gem. In this video, I show you just how easy it is.
šŸ¤Æ Support on Patreon
  • https://www.patreon.com/davidwparker

ā±ļø Timestamps:
  • 00:00 - Introduction
  • 00:38 - Test Coverage
  • 01:00 - Friendly Gem
  • 02:00 - Gemfile
  • 03:00 - Database migration
  • 03:25 - Friendly config
  • 04:05 - routes
  • 05:40 - user model
  • 08:10 - user request spec

šŸ’Œ Newsletter:
  • https://www.programmingtil.com/

šŸŖElsewhere:
  • Twitter: https://twitter.com/davidwparker
  • Twitter: https://twitter.com/programmingtil
  • GitHub: https://github.com/davidwparker

šŸ’­Concepts:
  • How to make pretty URLs in Ruby on Rails with Friendly Gem

šŸ“šResources:
  • https://github.com/davidwparker/programmingtil-rails/tree/ep18
  • https://github.com/norman/friendlyid

šŸŽ¬ 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