app/helpers/katalyst/tables/frontend.rb in katalyst-tables-3.1.0 vs app/helpers/katalyst/tables/frontend.rb in katalyst-tables-3.2.0
- old
+ new
@@ -67,9 +67,17 @@
component = component.new(model:, **)
render(component, &)
end
+ # Construct a new filter.
+ #
+ # @param collection [Katalyst::Tables::Collection::Core] the collection to render
+ # @param url [String] the url to submit the form to (e.g. <resources>_path)
+ def filter_with(collection:, url: url_for(action: :index), &)
+ render(FilterComponent.new(collection:, url:), &)
+ end
+
private
def default_table_component_class
component = controller.try(:default_table_component) || TableComponent
component.respond_to?(:constantize) ? component.constantize : component