FriendlyId is a Rails gem that provides human-readable slugs for ActiveRecord models, replacing numeric IDs in URLs with meaningful strings. For example, instead of /articles/123, you can have /articles/my-first-post. It integrates with ActiveRecord to generate slugs automatically based on attributes (like a title) and manages uniqueness, history, and slug regeneration when records change. FriendlyId also supports features like slug candidates, scoped slugs, and reserved word handling to avoid conflicts. It includes extensions to keep old slugs working as redirects, so links don’t break when content is renamed. By improving readability, SEO, and user-friendliness, FriendlyId has become the de facto solution for slugging in Rails applications.

Features

  • Generate and use slugs (human readable strings) instead of numeric IDs in URLs
  • Slug history and versioning (so old slugs remain valid after changes)
  • Scoped slugs (so the same slug can be reused in different contexts/scopes)
  • Reserved words to prevent certain words or paths from being used as slugs
  • Custom slug generators so you can define how slugs are constructed (e.g. combining multiple fields, candidate slugs)
  • Enhanced finders: ability to find by slug (and/or fallback to numeric ID), query using friendly.find etc.

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow FriendlyId

FriendlyId Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of FriendlyId!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby Libraries

Registered

2025-09-17