I\'m trying to make some restaurant list. I associated two tables, and then write this code.
class Restaurant < ActiveRecord::Base
has_many :resta
because Restaurent has_many :restaurant_translations so you need to loop through
restaurant.restaurant_translations.each do|res_trans|
your code here
end
replace
td = restaurant.restaurant_translations.restaurantname
with
td = restaurant.restaurant_translations.first.restaurantname
this will help you
Your restauration have multiple 'restaurant_translations'.
Example, for first you can write td = restaurant.restaurant_translations.first.try(:restaurantname)