You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ created by [Ernie Miller](http://twitter.com/erniemiller)
9
9
and developed/maintained for years by
10
10
[Jon Atack](http://twitter.com/jonatack) and
11
11
[Ryan Bigg](http://twitter.com/ryanbigg) with the help of a great group of
12
-
[contributors](https://github.com/activerecord-hackery/ransack/graphs/contributors). Ransack's logo is designed by [Anıl Kılıç](https://github.com/anilkilic).
12
+
[contributors](https://github.com/activerecord-hackery/ransack/graphs/contributors). Ransack's logo is designed by [Anıl Kılıç](https://github.com/anilkilic).
13
13
While it supports many of the same features as MetaSearch, its underlying
14
14
implementation differs greatly from MetaSearch,
15
15
and backwards compatibility is not a design goal.
@@ -133,8 +133,8 @@ which are defined in
133
133
```
134
134
135
135
The argument of `f.search_field` has to be in this form:
136
-
`attribute_name[_or_attribute_name]..._predicate`
137
-
136
+
`attribute_name[_or_attribute_name]..._predicate`
137
+
138
138
where `[_or_another_attribute_name]...` means any repetition of `_or_` plus the name of the attribute.
139
139
140
140
`cont` (contains) and `start` (starts with) are just two of the available
@@ -201,6 +201,23 @@ This example toggles the sort directions of both fields, by default
201
201
initially sorting the `last_name` field by ascending order, and the
202
202
`first_name` field by descending order.
203
203
204
+
In the case that you wish to sort by some complex value, such as the result
205
+
of a SQL function, you may do so using scopes. In your model, define scopes
206
+
whose names line up with the name of the virtual field you wish to sort by,
0 commit comments