Skip to content

Instantly share code, notes, and snippets.

@ogredude
Created July 7, 2011 21:54
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 ogredude/1070638 to your computer and use it in GitHub Desktop.
Save ogredude/1070638 to your computer and use it in GitHub Desktop.
Is there a better way to do this?
# The goal is to end up with a list of items in the store that the user did NOT check. Items the user checked are in the params[:item_ids] array.
# There's got to be a better way... But how?
store.items.each do |i|
does_not_want << i.item_id unless params[:item_ids].include?(i.item_id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment