Best way to generate slugs (human-readable IDs) in Rails

前端 未结 12 824
北荒
北荒 2020-11-30 18:05

You know, like myblog.com/posts/donald-e-knuth.

Should I do this with the built in parameterize method?

What about a plugin? I could imagine a plugin being n

12条回答
  •  情深已故
    2020-11-30 19:05

    The Unidecoder gem hasn't been updated since 2007.

    I'd recommend the stringex gem, which includes the functionality of the Unidecoder gem.

    https://github.com/rsl/stringex

    Looking at it's source code, it seems to repackage the Unidecoder source code and add new functionality.

提交回复
热议问题