mirror of https://github.com/rails/rails
Remove trailing commas in advanced route constraints example
This commit is contained in:
parent
9d8ff32372
commit
8b3f3c8561
|
@ -787,8 +787,8 @@ end
|
|||
|
||||
Rails.application.routes.draw do
|
||||
constraints(RestrictedListConstraint.new) do
|
||||
get '*path', to: 'restricted_list#index',
|
||||
get '*other-path', to: 'other_restricted_list#index',
|
||||
get '*path', to: 'restricted_list#index'
|
||||
get '*other-path', to: 'other_restricted_list#index'
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -798,8 +798,8 @@ You can also use a `lambda`:
|
|||
```ruby
|
||||
Rails.application.routes.draw do
|
||||
constraints(lambda { |request| RestrictedList.retrieve_ips.include?(request.remote_ip) }) do
|
||||
get '*path', to: 'restricted_list#index',
|
||||
get '*other-path', to: 'other_restricted_list#index',
|
||||
get '*path', to: 'restricted_list#index'
|
||||
get '*other-path', to: 'other_restricted_list#index'
|
||||
end
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue