0

I'm using friendly_id 5.2.

By default, it just appends a random UUID on the end for what would be duplicate slugs (post-60948cdd-d73c-4b77-9676-ecdf7727c396), but with the sequentially_slugged method you can just turn it back to how it worked in version 4 where it appends a dash and then a number on the end (post-7).

What's the best way to replace the dash with a forward slash? post/7 (ordered by when they were created).

As far as I understand, you'd want to allow duplicate slugs in the gem and then just change the routes on Rails' end.

JackHasaKeyboard
  • 1,599
  • 1
  • 16
  • 29

1 Answers1

0

As I read in the documentation

Instance Attribute Summary

  • (Object) sequence_separator The string used to separate a slug base from a numeric sequence.
  • (Object) slug_column The column that will be used to store the generated slug.
  • (Object) slug_generator_class Returns the value of attribute slug_generator_class.

Instance Attribute Details

  • (Object) sequence_separator The string used to separate a slug base from a numeric sequence.

You can change the default separator by setting the sequence_separator configuration option.

Returns:

String The sequence separator string. Defaults to "-".

Community
  • 1
  • 1
Fabrizio Bertoglio
  • 5,890
  • 4
  • 16
  • 57