Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <%= form_for(@sundae) do |f| %>
  2. <!--
  3. collection_check_boxes requires 4 parameters, the last two are methods that access
  4. the value and text from the collection, respectively. Hence the need for
  5. SundaesHelper.valid_flavors!
  6. -->
  7. <%= f.collection_check_boxes(:flavor_list, valid_flavors, :first, :first) do |b| %>
  8. <!-- FYI: I use Bootstrap 4, so I customized how the checkboxes would render -->
  9. <div class="form-check">
  10. <label class="form-check-label"><%= b.check_box class: 'form-check-input' %> <%= b.value %></label>
  11. </div>
  12. <% end %>
  13.  
  14. <%= f.submit %>
  15. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement