Sha256: d635eafb4bd1b2db44613f465e11390f8d8898fa8ba909e71edff3914712741a

Contents?: true

Size: 693 Bytes

Versions: 61

Compression:

Stored size: 693 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helper that provides a single method to create filter resource forms
  module FiltersHelper
    # This method wraps everything in a div with class filters and calls
    # the form_for helper with a custom builder
    #
    # filter - A filter object
    # block  - A block to be called with the form builder
    #
    # Returns the filter resource form wrapped in a div
    def filter_form_for(filter)
      content_tag :div, class: "filters" do
        form_for filter, builder: FilterFormBuilder, url: url_for, as: :filter, method: :get, remote: true, html: { id: nil } do |form|
          yield form
        end
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 2 rubygems

Version Path
decidim-core-0.14.4 app/helpers/decidim/filters_helper.rb
decidim-core-0.14.3 app/helpers/decidim/filters_helper.rb
decidim-core-0.14.2 app/helpers/decidim/filters_helper.rb
decidim-core-0.14.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.13.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.12.2 app/helpers/decidim/filters_helper.rb
decidim-core-0.13.0 app/helpers/decidim/filters_helper.rb
decidim-core-0.12.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.13.0.pre1 app/helpers/decidim/filters_helper.rb
decidim-core-0.12.0 app/helpers/decidim/filters_helper.rb
decidim-core-0.11.2 app/helpers/decidim/filters_helper.rb
decidim-core-0.12.0.pre app/helpers/decidim/filters_helper.rb
decidim-core-0.11.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.11.0.pre1 app/helpers/decidim/filters_helper.rb
decidim-core-0.10.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.10.0 app/helpers/decidim/filters_helper.rb
decidim-core-0.9.3 app/helpers/decidim/filters_helper.rb
decidim-core-0.9.2 app/helpers/decidim/filters_helper.rb
decidim-core-0.9.1 app/helpers/decidim/filters_helper.rb
decidim-core-0.9.0 app/helpers/decidim/filters_helper.rb