> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# Ruby: delete multiple hash keys
- URL: https://til.codes/ruby-delete-multiple-hash-keys/
- Published: 2015-07-24T09:16:19.000Z
- Updated: 2015-07-24T09:16:19.000Z
- Author: Manu Ajith
- Tags: ruby, hash, #Import 2024-07-13 21:01

Returns a hash that includes everything but the given keys.

```
hash = { a: true, b: false, c: nil}
hash.except(:c) # => { a: true, b: false}
hash # => { a: true, b: false, c: nil}

```

This is useful for limiting a set of parameters to everything but a few known toggles:

```
@person.update(params[:person].except(:admin))

```