Skip to content

Commit 85fba83

Browse files
authored
Merge pull request #1753 from mr-dxdy/links_in_readme
Update links in README
2 parents 3cd7f86 + 0d94d14 commit 85fba83

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222
group :test do
2323
gem 'cookiejar'
2424
gem 'coveralls', '~> 0.8.17', require: false
25-
gem 'danger-toc', '~> 0.1.0'
25+
gem 'danger-toc', '~> 0.1.2'
2626
gem 'grape-entity', '~> 0.6'
2727
gem 'maruku'
2828
gem 'mime-types'

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,31 @@
4545
- [Group Options](#group-options)
4646
- [Alias](#alias)
4747
- [Built-in Validators](#built-in-validators)
48-
- [`allow_blank`](#allowblank)
48+
- [`allow_blank`](#allow_blank)
4949
- [`values`](#values)
50-
- [`except_values`](#exceptvalues)
50+
- [`except_values`](#except_values)
5151
- [`regexp`](#regexp)
52-
- [`mutually_exclusive`](#mutuallyexclusive)
53-
- [`exactly_one_of`](#exactlyoneof)
54-
- [`at_least_one_of`](#atleastoneof)
55-
- [`all_or_none_of`](#allornoneof)
56-
- [Nested `mutually_exclusive`, `exactly_one_of`, `at_least_one_of`, `all_or_none_of`](#nested-mutuallyexclusive-exactlyoneof-atleastoneof-allornoneof)
52+
- [`mutually_exclusive`](#mutually_exclusive)
53+
- [`exactly_one_of`](#exactly_one_of)
54+
- [`at_least_one_of`](#at_least_one_of)
55+
- [`all_or_none_of`](#all_or_none_of)
56+
- [Nested `mutually_exclusive`, `exactly_one_of`, `at_least_one_of`, `all_or_none_of`](#nested-mutually_exclusive-exactly_one_of-at_least_one_of-all_or_none_of)
5757
- [Namespace Validation and Coercion](#namespace-validation-and-coercion)
5858
- [Custom Validators](#custom-validators)
5959
- [Validation Errors](#validation-errors)
6060
- [I18n](#i18n)
6161
- [Custom Validation messages](#custom-validation-messages)
62-
- [`presence`, `allow_blank`, `values`, `regexp`](#presence-allowblank-values-regexp)
63-
- [`mutually_exclusive`](#mutuallyexclusive-1)
62+
- [`presence`, `allow_blank`, `values`, `regexp`](#presence-allow_blank-values-regexp)
63+
- [`all_or_none_of`](#all_or_none_of-1)
64+
- [`mutually_exclusive`](#mutually_exclusive-1)
65+
- [`exactly_one_of`](#exactly_one_of-1)
66+
- [`at_least_one_of`](#at_least_one_of-1)
67+
- [`Coerce`](#coerce)
68+
- [`With Lambdas`](#with-lambdas)
69+
- [`Pass symbols for i18n translations`](#pass-symbols-for-i18n-translations)
6470
- [Overriding Attribute Names](#overriding-attribute-names)
6571
- [With Default](#with-default)
72+
- [Headers](#headers)
6673
- [Routes](#routes)
6774
- [Helpers](#helpers)
6875
- [Path Helpers](#path-helpers)
@@ -118,10 +125,10 @@
118125
- [Reloading in Rails Applications](#reloading-in-rails-applications)
119126
- [Performance Monitoring](#performance-monitoring)
120127
- [Active Support Instrumentation](#active-support-instrumentation)
121-
- [endpoint_run.grape](#endpointrungrape)
122-
- [endpoint_render.grape](#endpointrendergrape)
123-
- [endpoint_run_filters.grape](#endpointrunfiltersgrape)
124-
- [endpoint_run_validators.grape](#endpointrunvalidatorsgrape)
128+
- [endpoint_run.grape](#endpoint_rungrape)
129+
- [endpoint_render.grape](#endpoint_rendergrape)
130+
- [endpoint_run_filters.grape](#endpoint_run_filtersgrape)
131+
- [endpoint_run_validators.grape](#endpoint_run_validatorsgrape)
125132
- [Monitoring Products](#monitoring-products)
126133
- [Contributing to Grape](#contributing-to-grape)
127134
- [License](#license)
@@ -1550,6 +1557,7 @@ params do
15501557
requires :name, values: { value: 1..10, message: 'not in range from 1 to 10' }, allow_blank: { value: false, message: 'cannot be blank' }, regexp: { value: /^[a-z]+$/, message: 'format is invalid' }, message: 'is required'
15511558
end
15521559
```
1560+
15531561
#### `all_or_none_of`
15541562

15551563
```ruby
@@ -1571,6 +1579,7 @@ params do
15711579
mutually_exclusive :beer, :wine, :juice, message: "are mutually exclusive cannot pass both params"
15721580
end
15731581
```
1582+
15741583
#### `exactly_one_of`
15751584

15761585
```ruby
@@ -1581,6 +1590,7 @@ params do
15811590
exactly_one_of :beer, :wine, :juice, message: {exactly_one: "are missing, exactly one parameter is required", mutual_exclusion: "are mutually exclusive, exactly one parameter is required"}
15821591
end
15831592
```
1593+
15841594
#### `at_least_one_of`
15851595

15861596
```ruby
@@ -1591,20 +1601,23 @@ params do
15911601
at_least_one_of :beer, :wine, :juice, message: "are missing, please specify at least one param"
15921602
end
15931603
```
1604+
15941605
#### `Coerce`
15951606

15961607
```ruby
15971608
params do
15981609
requires :int, type: {value: Integer, message: "type cast is invalid" }
15991610
end
16001611
```
1612+
16011613
#### `With Lambdas`
16021614

16031615
```ruby
16041616
params do
16051617
requires :name, values: { value: -> { (1..10).to_a }, message: 'not in range from 1 to 10' }
16061618
end
16071619
```
1620+
16081621
#### `Pass symbols for i18n translations`
16091622

16101623
You can pass a symbol if you want i18n translations for your custom validation messages.
@@ -1652,6 +1665,7 @@ params do
16521665
requires :name, values: { value: -> { (1..10).to_a }, message: 'not in range from 1 to 10' }, default: 5
16531666
end
16541667
```
1668+
16551669
## Headers
16561670

16571671
Request headers are available through the `headers` helper or from `env` in their original form.

0 commit comments

Comments
 (0)