diff --git a/docs/3.0/dynamic-filters.md b/docs/3.0/dynamic-filters.md index e5a78a07..3557e9d0 100644 --- a/docs/3.0/dynamic-filters.md +++ b/docs/3.0/dynamic-filters.md @@ -57,8 +57,14 @@ There are a few types of filters available for you to use out of the box. - Is true - Is false - - Is present - - Is blank + - Is null + - Is not null +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/users?filters[is_admin?][is_true][]=), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/user.rb#L38) ::: :::option Date @@ -70,8 +76,20 @@ There are a few types of filters available for you to use out of the box. - Is on or before - Is on or after - Is within - - Is present - - Is blank +- Is null + - Is not null + +
+
+ + +
+
+ +
+
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/teams?filters[created_at][lte][]=2024-07-02%2012%3A00), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/team.rb#L50) ::: :::option Has many @@ -80,10 +98,22 @@ This filter will give you options from the database. ### Conditions + - Contains + - Does not contain - Is - Is not + - Starts with + - Ends with + - Is null + - Is not null - Is present - Is blank +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/teams?filters[memberships][contains][]=), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/team.rb#L75) ::: :::option Number @@ -96,8 +126,13 @@ This filter will give you options from the database. - `>=` (greater than or equal to) - `<` (lower than) - `<=` (lower than or equal to) - - Is present - - Is blank + +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/teams?filters[id][gte][]=2), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/team.rb#L27) ::: :::option Select @@ -106,8 +141,14 @@ This filter will give you options from the database. - Is - Is not - - Is present - - Is blank + - Is null + - Is not null +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/courses?filters[country][is][]=USA), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/course.rb#L55) ::: :::option Text @@ -120,10 +161,18 @@ This filter will give you options from the database. - Is not - Starts with - Ends with + - Is null + - Is not null - Is present - Is blank -::: +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/users?filters[first_name][contains][]=Avo), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/user.rb#L33) +::: ::::option Tags ### Conditions @@ -136,6 +185,12 @@ This filter will give you options from the database. :::warning Contained in will not work when using the `acts-as-taggable-on` gem. ::: +
+ + +
+ +Test it on [avodemo](https://main.avodemo.com/avo/resources/courses?filters[skills][array_contains][]=), check the [source code](https://github.com/avo-hq/main.avodemo.com/blob/main/app/avo/resources/course.rb#L42) :::: diff --git a/docs/3.0/search.md b/docs/3.0/search.md index 0da21056..7d6439ef 100644 --- a/docs/3.0/search.md +++ b/docs/3.0/search.md @@ -302,3 +302,13 @@ You can perform a search on `Application` records based on attributes of the ass In the above example, ransack is used to search for `Application` records based on various attributes of the associated `Client`, such as client_email_cont and client_phone_number_cont. The joins method is used to join the applications table with the clients table to perform the search efficiently. This approach allows for flexible searching within associations, enabling you to find records based on related model attributes. + +## Results count +:::info Since version +::: +By default, Avo displays 8 search results whenever you search. You can change the number of results displayed by configuring the `search_results_count` option: + +```ruby +Avo.configure do |config| + config.search_results_count = 16 +end diff --git a/docs/public/assets/img/dynamic_filter_boolean.png b/docs/public/assets/img/dynamic_filter_boolean.png new file mode 100644 index 00000000..8ce353f9 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_boolean.png differ diff --git a/docs/public/assets/img/dynamic_filter_boolean2.png b/docs/public/assets/img/dynamic_filter_boolean2.png new file mode 100644 index 00000000..8fd62d93 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_boolean2.png differ diff --git a/docs/public/assets/img/dynamic_filter_date.png b/docs/public/assets/img/dynamic_filter_date.png new file mode 100644 index 00000000..defddddb Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_date.png differ diff --git a/docs/public/assets/img/dynamic_filter_date2.png b/docs/public/assets/img/dynamic_filter_date2.png new file mode 100644 index 00000000..7ab4129d Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_date2.png differ diff --git a/docs/public/assets/img/dynamic_filter_date3.png b/docs/public/assets/img/dynamic_filter_date3.png new file mode 100644 index 00000000..2f545030 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_date3.png differ diff --git a/docs/public/assets/img/dynamic_filter_has_many.png b/docs/public/assets/img/dynamic_filter_has_many.png new file mode 100644 index 00000000..89b17230 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_has_many.png differ diff --git a/docs/public/assets/img/dynamic_filter_has_many2.png b/docs/public/assets/img/dynamic_filter_has_many2.png new file mode 100644 index 00000000..30f750ae Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_has_many2.png differ diff --git a/docs/public/assets/img/dynamic_filter_number.png b/docs/public/assets/img/dynamic_filter_number.png new file mode 100644 index 00000000..dc776b8d Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_number.png differ diff --git a/docs/public/assets/img/dynamic_filter_number2.png b/docs/public/assets/img/dynamic_filter_number2.png new file mode 100644 index 00000000..a6f6e7ee Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_number2.png differ diff --git a/docs/public/assets/img/dynamic_filter_select.png b/docs/public/assets/img/dynamic_filter_select.png new file mode 100644 index 00000000..9478bcb9 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_select.png differ diff --git a/docs/public/assets/img/dynamic_filter_select2.png b/docs/public/assets/img/dynamic_filter_select2.png new file mode 100644 index 00000000..f8b8a807 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_select2.png differ diff --git a/docs/public/assets/img/dynamic_filter_tags.png b/docs/public/assets/img/dynamic_filter_tags.png new file mode 100644 index 00000000..5054b6bf Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_tags.png differ diff --git a/docs/public/assets/img/dynamic_filter_tags2.png b/docs/public/assets/img/dynamic_filter_tags2.png new file mode 100644 index 00000000..cd7113b8 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_tags2.png differ diff --git a/docs/public/assets/img/dynamic_filter_text.png b/docs/public/assets/img/dynamic_filter_text.png new file mode 100644 index 00000000..a23fb520 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_text.png differ diff --git a/docs/public/assets/img/dynamic_filter_text2.png b/docs/public/assets/img/dynamic_filter_text2.png new file mode 100644 index 00000000..2d4b7552 Binary files /dev/null and b/docs/public/assets/img/dynamic_filter_text2.png differ