Tagmap.where(user_id: current_user.id).uniq(:name)
This query doesn't seem to work. It still fetches all the records belonging to that user only.
您可以使用group by SQL查询。
Tagmap.where(user_id: current_user.id).group(:name)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.