Ruby on Rails - Show field from has_many table
问题 I've got two tables: Ships and Voyages. A ship can have many voyages, but a voyage may only have one ship. In RoR the ship model has a has_many :voyages and the Voyage model is set to belongs_to: ship I can display all of the fields from the ship table in the view without any problems using code similar to this: <%= @ship_data.id %> I'm now trying to show a piece of information from the voyage table in the view. If I do: <%= @ship_data.voyages %> I'm able to pull up the ActiveRecord entry i.e