Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Gems
  3. FriendlyId

FriendlyId

MITRubyv5.7.0

A comprehensive slugging and permalink plugin for ActiveRecord that creates human-friendly URLs and works with strings as numeric IDs.

Visit WebsiteGitHubGitHub
6.2k stars592 forks0 contributors

What is FriendlyId?

FriendlyId is an ActiveRecord plugin that replaces numeric IDs in URLs with human-readable slugs. It solves the problem of unfriendly, numeric-based URLs by allowing developers to work with string identifiers as seamlessly as they would with numeric IDs, improving both user experience and SEO.

Target Audience

Ruby on Rails developers building content-heavy applications like blogs, e-commerce sites, or content management systems where readable URLs are important.

Value Proposition

Developers choose FriendlyId for its comprehensive feature set including slug history, i18n support, and scoped slugs—all while maintaining full ActiveRecord compatibility. It's battle-tested and handles edge cases that simpler slugging solutions might miss.

Overview

FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.

Use Cases

Best For

  • Converting numeric database IDs to readable URLs in Rails applications
  • Maintaining SEO value when content titles change (slug history)
  • Building multilingual Rails apps with localized URLs
  • Ensuring unique slugs within specific scopes like user profiles or categories
  • Replacing numeric IDs with human-friendly strings in ActiveRecord queries
  • Creating pretty permalinks for blog posts, products, or user profiles

Not Ideal For

  • Applications using non-ActiveRecord ORMs like Sequel or Mongoid
  • High-frequency write systems where slug generation overhead could impact performance
  • Microservices or APIs that handle URL routing externally, not within Rails controllers
  • Projects requiring minimal database migrations or zero-additional tables

Pros & Cons

Pros

Comprehensive Slug Features

Includes slug history, i18n support, and scoped slugs, as highlighted in the key features, ensuring SEO-friendly URLs even when content changes.

Seamless ActiveRecord Integration

Maintains full compatibility with ActiveRecord, allowing use of friendly.find in controllers without breaking existing queries, as shown in the usage examples.

Customization Flexibility

Supports custom slug generators and reserved words, enabling developers to tailor slug creation logic for complex requirements.

Battle-Tested Reliability

Long-term maintenance and a wide contributor base, mentioned in the credits, indicate stability for production use.

Cons

Setup Complexity

Requires multiple steps: adding gems, generating migrations, and modifying models/controllers, with optional slug history adding extra database tables.

ActiveRecord Lock-in

Tightly coupled to ActiveRecord, making it unsuitable for Rails apps using alternative ORMs or non-Rails frameworks.

Performance Overhead

Slug history maintenance and additional database lookups can slow down high-traffic applications, especially with frequent updates.

Frequently Asked Questions

Quick Stats

Stars6,225
Forks592
Contributors0
Open Issues27
Last commit12 days ago
CreatedSince 2008

Tags

#rails#slug-generation#plugin#activerecord#ruby-on-rails#slug#ruby#rails-plugins#database-ids

Built With

R
Rails
R
Ruby
A
ActiveRecord

Links & Resources

Website

Included in

Ruby14.1kRails3.9kGems2.8k
Auto-fetched 16 hours ago

Related Projects

devisedevise

Flexible authentication solution for Rails with Warden.

Stars24,343
Forks5,480
Last commit1 month ago
spreespree

Open Source eCommerce Platform for B2B, Marketplace, and Enterprise. REST API, TypeScript SDK, and production-ready Next.js storefront. Self-host it. Own your stack. No vendor lock-in. Zero platform fees.

Stars15,570
Forks5,288
Last commit1 day ago
activeadminactiveadmin

The administration framework for Ruby on Rails applications.

Stars9,704
Forks3,324
Last commit1 day ago
CarrierwaveCarrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks

Stars8,783
Forks1,650
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub