Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7799125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:12:25+00:00 2026-06-02T00:12:25+00:00

Curious as to why friendly_id encourage 2 dashes, instead of one? Am interested why

  • 0

Curious as to why friendly_id encourage 2 dashes, instead of one?

Am interested why this is the default logic. Any reason why they chose two dashes, instead of one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:12:27+00:00Added an answer on June 2, 2026 at 12:12 am

    I thought about this recently and tried to change the sequence separator to 1 dash and FriendlyId complained, apparently for a valid reason.

    This link doesn’t answer your question exactly:
    https://github.com/norman/friendly_id/blob/master/lib/friendly_id/slugged.rb#L87-92

    However, there’s a tiny bit more info here:
    https://github.com/norman/friendly_id/blob/master/lib/friendly_id/slugged.rb#L293-305

    I also saw that when I was using the history module, and performing a create, it checks for more recent slugs by appending a the sequence separator to the end.

    eg:

    Category.create(:name => 'foo')
    

    returned the following sql queries

    (0.1ms)  BEGIN
    FriendlyId::Slug Load (49.9ms)  SELECT "friendly_id_slugs".* FROM "friendly_id_slugs" WHERE "friendly_id_slugs"."sluggable_type" = 'Category' AND (slug = 'foo' OR slug LIKE 'foo--%') ORDER BY LENGTH(slug) DESC, slug DESC LIMIT 1
    

    If you changed the sequence separator to 1 dash, it would match items with slugs like ‘foo-bar’ and ‘foo-moo’ etc …

    Hope this helps satisfy your curiosity 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Out of pure interested, I'm curious how to create PI sequentially so that instead
Curious how this could be done. Is there any way to create a delegate
Curious, what happens when you return keyword this from a struct in C#? For
Curious what "Toast" means? Saw this and am curious... Similar Posts How to add
Curious if anyone ever noticed this, but I have a WYSIWYG that users occassionally
Curious if anyone has this problem: I save my (embedded) fonts in an external
Just curious (maybe this is an implementation detail so you may not know) but
Curious as to how to approach this same problem using ruby / rails -
Curious about things to consider to avoid any code breaks, etc to upgrade from
Curious if there any API wrappers for Git and Subversion for Java? I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.