My githup repo is up to date and I have updated the heroku http://glacial-beyond-1616.herokuapp.com/ The github is https://github.com/fheld/mowheels. On the heroku, you will have to register, but there is no checks right now.
I have a
collection_select that is populating fine. I just want the following code in my
Recipients_Menu view to when the selection box is changed, that it goes to the Menu model and selects the record with the id of the selected menu and brings it back so that the menu object is populated and not nil,
The code looks like this:
<%= form_for(@recipient_menu) do |f| %> <% if @recipient_menu.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@recipient_menu.errors.count, "error") %> prohibited this recipient_menu from being saved:</h2> <ul> <% @recipient_menu.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :recipient_id %><br> <%# f.number_field :recipient_id %> <%= f.collection_select :recipient_id, Recipient.all, :id, :first_last_name %> </div> <div class="field"> <%= f.label :menu_id %><br> <%# f.number_field :menu_id %> <%= f.collection_select :menu_id, Menu.all, :id, :menu_date %> </div> <div class="field"> <%= f.label :main_dish1 %><br> <% if @menu %> <%= @menu.main_dish1 %> <% end %>
I need to find out what the Menu selected was on the
collection_select and then go get the record with that ID and bring it back to fill in the menu on the form.