app/controllers/administrate/application_controller.rb in administrate-0.3.0 vs app/controllers/administrate/application_controller.rb in administrate-0.4.0
- old
+ new
@@ -11,10 +11,11 @@
render locals: {
resources: resources,
search_term: search_term,
page: page,
+ show_search_bar: show_search_bar?
}
end
def show
render locals: {
@@ -119,8 +120,14 @@
def translate_with_resource(key)
t(
"administrate.controller.#{key}",
resource: resource_resolver.resource_title,
)
+ end
+
+ def show_search_bar?
+ dashboard.attribute_types_for(
+ dashboard.collection_attributes
+ ).any? { |_name, attribute| attribute.searchable? }
end
end
end