Why can't show restaurant list?

后端 未结 3 1558
终归单人心
终归单人心 2020-12-12 08:21

I\'m trying to make some restaurant list. I associated two tables, and then write this code.

class Restaurant < ActiveRecord::Base
        has_many :resta         


        
3条回答
  •  盖世英雄少女心
    2020-12-12 08:48

    because Restaurent has_many :restaurant_translations so you need to loop through

    restaurant.restaurant_translations.each do|res_trans|
    your code here
    end
    

提交回复
热议问题