My model is -
class TripLeg < ActiveRecord::Base
belongs_to :airport, :foreign_key => :start_airport_id
belongs_to :airport, :foreign_key => :end_airport_id
validates_presence_of :trip_id, :trip_id_sequence, :start_airport_id,
You’ll notice the two foreign keys to airport, for the start and end
the trip leg.
I now want to display the airport names on a view. I’d normally code -
but this doesn’t work here.
How do I tell it to go from a specific column to airport ?