Need data from rails join table, has_many :through

前端 未结 3 924
眼角桃花
眼角桃花 2020-12-05 11:57

I have 3 tables - users, things, and follows. Users can follow things through the follows table, associating a user_id with a things_id. This would

3条回答
  •  独厮守ぢ
    2020-12-05 12:32

    You might be able to do something like:

    <% things.follows.each do |follow| %>
      <%= follow.relation %>
      <%= follow.user %>
    <% end %>
    

提交回复
热议问题