Adding tags to posts in Ruby on Rails

后端 未结 3 1385
抹茶落季
抹茶落季 2021-01-02 00:25

I am creating a blog in Rails using Scaffolding. I want to add a \'tags\' field on each post like on StackOverflow and WordPress. I can do this with the string type (

3条回答
  •  甜味超标
    2021-01-02 00:55

    Tagging is so common that implementations are a commodity. I believe "acts as taggable on" is usually the preferred way of implementing tags.

    See other popular solutions here.

    If you wish to implement it yourself, you could dive into the source code to find some ideas.

提交回复
热议问题