I’m working on a food program. The user defines foods, enters their
calories, etc. Then the user goes into a day view with defines a meal
by selected the foods from a drop down list.
So I have a foods controller, a meals controller.
I have the meals model defined with has_many :foods
And I have the foods controller defined with belongs_to :meal
But when I’m not sure when I create the form for it:
<%= error_messages_for :meal %>
<% form_for(@meal) do |f| %>
<%= f.datetime_select :time %>
<%= f.text_select :food %>
<%= f.submit "Create" %><% end %>
<%= link_to ‘Back’, meals_path %>
The issue is I need f.text_select and the options available to the
user to come from the food table. Anybody know how that would look in