Why can't show restaurant list?

后端 未结 3 1551
终归单人心
终归单人心 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:56

    Your restauration have multiple 'restaurant_translations'.

    Example, for first you can write td = restaurant.restaurant_translations.first.try(:restaurantname)

提交回复
热议问题