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

前端 未结 12 851
北荒
北荒 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:06

    We use to_slug http://github.com/ludo/to_slug/tree/master. Does everything we need it to do (escaping 'funky characters'). Hope this helps.

    EDIT: Seems to be breaking my link, sorry about that.

提交回复
热议问题