Permalinks with Ruby on Rails (dynamic routes)

后端 未结 6 1260
眼角桃花
眼角桃花 2020-12-09 07:14

I am currently developing a blogging system with Ruby on Rails and want the user to define his \"permalinks\" for static pages or blog posts, meaning:

the user shoul

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 07:45

    You can use the friendly_id gem. There are no special controller changes required. Simple add an attribute for example slug to your model..for more details check out the github repo of the gem.

提交回复
热议问题