We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c0798e commit da7469cCopy full SHA for da7469c
app/controllers/avo/base_controller.rb
@@ -25,6 +25,8 @@ def index
25
end
26
add_breadcrumb @resource.plural_name.humanize
27
28
+ # Apply the search query if configured on the resource
29
+ apply_search_query if params[:q].present? && @resource.search.present?
30
set_index_params
31
set_filters
32
set_actions
@@ -658,5 +660,12 @@ def set_pagination_params
658
660
def set_query
659
661
@query ||= @resource.class.query_scope
662
663
+
664
+ def apply_search_query
665
+ search_query = @resource.search[:query]
666
+ return unless search_query.present?
667
668
+ @query = instance_exec(@query, &search_query)
669
+ end
670
671
0 commit comments