Skip to content

Instantly share code, notes, and snippets.

@sgonyea
Created June 28, 2011 06:13
Show Gist options
  • Save sgonyea/1050591 to your computer and use it in GitHub Desktop.
Save sgonyea/1050591 to your computer and use it in GitHub Desktop.
Ruby's Asterisk Operator is so useful
attrs = [*params['records']].pop || {}
@note = Note.find(params[:id])
attrs.delete :location_id
@note.update_attributes(attrs.slice(*Note.attribute_names))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment