% # headmin/filters # # ==== Options # * +url - Base url to send filter query to. Defaults to current URL # # ==== Examples # Basic version # <%= render "headmin/filters" do %#> # <%= render "headmin/filters/select", name: "color", options: ["red", "green", "blue"] %#> # <% end %#> # # With custom URL # <%= render "headmin/filters", url: admin_polls_path %#> action = local_assigns.has_key?(:url) ? url : request.path begin model = controller_name.singularize.capitalize.constantize rescue raise "Cannot find class!" end %> <%= form_with model: model.new, url: action, method: :get, data: {controller: "filters", filters_target: "form"} do |form| %> <%# Perform yield in order to capture content blocks, pass form so we can use headmin form inputs %> <%= yield(form) %> <% default_params.except("page").each do |name, value| %> <%= form.hidden_field name.to_sym, value: value %> <% end %>