Improve some wording and correct some typos (#1336)
* Unification of words "behaviour" -> "behavior" * Unify format - `a`, `b`, `c` -> `A`, `B`, `C` - D -> `D` * Fix typo "againt" -> "against" * Fix typo "Passanger" -> "Passenger" * Fix typo "qeury" -> "query"
This commit is contained in:
parent
887b410e38
commit
d8068565d9
|
@ -50,7 +50,7 @@ This may be disabled by setting the `strip_whitespace` option in a Ransack initi
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Ransack.configure do |c|
|
Ransack.configure do |c|
|
||||||
# Change whitespace stripping behaviour.
|
# Change whitespace stripping behavior.
|
||||||
# Default is true
|
# Default is true
|
||||||
c.strip_whitespace = false
|
c.strip_whitespace = false
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,24 +67,24 @@ When you're writing a `Ransack` search form, you can choose any of the following
|
||||||
|
|
||||||
### Option A - Match keys exactly
|
### Option A - Match keys exactly
|
||||||
|
|
||||||
Option `a` will match keys exactly. This is the solution to choose if you want to distinguish 'Home' from 'Homework': searching for 'Home' will return just the `Task` with id 1. It also allows searching for more than one tag at once (comma separated):
|
Option `A` will match keys exactly. This is the solution to choose if you want to distinguish 'Home' from 'Homework': searching for 'Home' will return just the `Task` with id 1. It also allows searching for more than one tag at once (comma separated):
|
||||||
- `Home, Personal` will return task 1
|
- `Home, Personal` will return task 1
|
||||||
- `Home, Homework` will return task 1 and 2
|
- `Home, Homework` will return task 1 and 2
|
||||||
|
|
||||||
### Option B - match key combinations
|
### Option B - match key combinations
|
||||||
|
|
||||||
Option `b` will match all keys exactly. This is the solution if you wanna search for specific combinations of tags:
|
Option `B` will match all keys exactly. This is the solution if you wanna search for specific combinations of tags:
|
||||||
- `Home` will return nothing, as there is no Task with just the `Home` tag
|
- `Home` will return nothing, as there is no Task with just the `Home` tag
|
||||||
- `Home, Personal` will return task 1
|
- `Home, Personal` will return task 1
|
||||||
|
|
||||||
### Option C - match substrings
|
### Option C - match substrings
|
||||||
|
|
||||||
Option `c` is used to match substrings. This is useful when you don't care for the exact tag, but only for part of it:
|
Option `C` is used to match substrings. This is useful when you don't care for the exact tag, but only for part of it:
|
||||||
- `Home` will return task 1 and 2 (`/Home/` matches both `"Home"` and `"Homework"`)
|
- `Home` will return task 1 and 2 (`/Home/` matches both `"Home"` and `"Homework"`)
|
||||||
|
|
||||||
### Option D - select from a list of tags
|
### Option D - select from a list of tags
|
||||||
|
|
||||||
In Option D we allow the user to select a list of valid tags and then search againt them. We use the plural name here.
|
In Option `D` we allow the user to select a list of valid tags and then search against them. We use the plural name here.
|
||||||
|
|
||||||
```erb
|
```erb
|
||||||
<div class='form-group'>
|
<div class='form-group'>
|
||||||
|
|
|
@ -27,7 +27,7 @@ en:
|
||||||
gt: greater than
|
gt: greater than
|
||||||
lt: less than
|
lt: less than
|
||||||
models:
|
models:
|
||||||
person: Passanger
|
person: Passenger
|
||||||
attributes:
|
attributes:
|
||||||
person:
|
person:
|
||||||
name: Full Name
|
name: Full Name
|
||||||
|
|
|
@ -368,7 +368,7 @@ module Ransack
|
||||||
expect(@s.result.to_sql).to match /#{field} IS NULL/
|
expect(@s.result.to_sql).to match /#{field} IS NULL/
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with association qeury' do
|
describe 'with association query' do
|
||||||
it 'generates a value IS NOT NULL query' do
|
it 'generates a value IS NOT NULL query' do
|
||||||
@s.comments_id_not_null = true
|
@s.comments_id_not_null = true
|
||||||
sql = @s.result.to_sql
|
sql = @s.result.to_sql
|
||||||
|
|
Loading…
Reference in New Issue