I am creating a flight booker in Rails and I'm having trouble showing my flight information for eligible flights on rails. The user can select to and from airports, passengers, and a date for the flight. If the flight exists it displays the information. But my flight isn't displaying.
index.html form to display the flights
<p>
<% unless @eligible_flights.empty? %>
<% @eligible_flights.each do |f| %>
<%= f.start_airport_id %>
<% end %>
<% else %>
<%= "No Flights Found" %>
<% end %>
</p>
flights controller to view
def index
@flights = Flight.all
@eligible_flights = Flight.where("start_airport_id = ? AND end_airport_id = ? AND departure_time = ?",
params[:start_airport],
params[:end_airport],
params[:departure_time])
end
Flight.allthe line before, just use a@flights.selectafterwards.