Skip to content

Commit

Permalink
Update README.md about values validator used with allow_blank
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Pankanin committed Aug 12, 2021
1 parent d37d471 commit 5b90b2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,14 @@ end

While Procs are convenient for single cases, consider using [Custom Validators](#custom-validators) in cases where a validation is used more than once.

Note that [allow_blank](#allow_blank) validator applies while using `:values`. In the following example the absence of `:allow_blank` does not prevent `:state` from receiving blank values because `:allow_blank` defaults to `true`.

```ruby
params do
requires :state, type: Symbol, values: [:active, :inactive]
end
```

#### `except_values`

Parameters can be restricted from having a specific set of values with the `:except_values` option.
Expand Down

0 comments on commit 5b90b2c

Please sign in to comment.