I have two models. The first is events and the second cities. in the events table i have an column which called city_id. I want the city name on each event show view.
In the events controller:
@city = City.where(:id => @event.city_id)
And in the view:
<%= @city.name %>
A city has many events and a event belongs to a city.
The output in my view is just the word city.
Hm, Where is the mistake?