Skip to content

Instantly share code, notes, and snippets.

@ornerymoose
Last active November 21, 2017 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ornerymoose/7642100052bfa5e9801912394ea81200 to your computer and use it in GitHub Desktop.
Save ornerymoose/7642100052bfa5e9801912394ea81200 to your computer and use it in GitHub Desktop.
undefined method `id' for nil:NilClass. Works when I remove the map and just do Child.all for the collection
<%= collection_check_boxes(:outage, :child_ids, Child.all.map{|c| c.omnia_trouble_ticket if !c.relationships.present?}, :id, :omnia_trouble_ticket) do |b| %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment