Rails route to username instead of id

后端 未结 4 1592
情书的邮戳
情书的邮戳 2020-12-05 05:07

I am trying to change the rails routes from /users/1 to /username. I currently set this up so it works for the actions of showing and editing. The actual issue is that when

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 05:34

    You can use friendly_id gem: https://github.com/norman/friendly_id

提交回复
热议问题