Class: Decidim::FilterFormBuilder
- Inherits:
-
FormBuilder
- Object
- FoundationRailsHelper::FormBuilder
- FormBuilder
- Decidim::FilterFormBuilder
- Defined in:
- decidim-core/lib/decidim/filter_form_builder.rb
Overview
This custom FormBuilder is used to create resource filter forms
Instance Method Summary collapse
-
#categories_select(method, collection, options = {}) ⇒ Object
Wrap the category select in a custom fieldset.
-
#collection_check_boxes(method, collection, value_method, label_method, options = {}, html_options = {}) ⇒ Object
Wrap the check_boxes collection in a custom fieldset.
-
#collection_radio_buttons(method, collection, value_method, label_method, options = {}, html_options = {}) ⇒ Object
Wrap the radio buttons collection in a custom fieldset.
-
#scopes_select(method, options = {}) ⇒ Object
Wrap the scopes select in a custom fieldset.
Methods inherited from FormBuilder
#check_box, #date_field, #datetime_field, #editor, #translated, #upload
Instance Method Details
#categories_select(method, collection, options = {}) ⇒ Object
Wrap the category select in a custom fieldset.
38 39 40 41 42 |
# File 'decidim-core/lib/decidim/filter_form_builder.rb', line 38 def categories_select(method, collection, = {}) fieldset_wrapper [:legend_title] do super(method, collection, ) end end |
#collection_check_boxes(method, collection, value_method, label_method, options = {}, html_options = {}) ⇒ Object
Wrap the check_boxes collection in a custom fieldset. It also renders the inputs inside its labels.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'decidim-core/lib/decidim/filter_form_builder.rb', line 25 def collection_check_boxes(method, collection, value_method, label_method, = {}, = {}) fieldset_wrapper [:legend_title] do super(method, collection, value_method, label_method, , ) do |builder| if block_given? yield builder else builder.label { builder.check_box + builder.text } end end end end |
#collection_radio_buttons(method, collection, value_method, label_method, options = {}, html_options = {}) ⇒ Object
Wrap the radio buttons collection in a custom fieldset. It also renders the inputs inside its labels.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'decidim-core/lib/decidim/filter_form_builder.rb', line 11 def (method, collection, value_method, label_method, = {}, = {}) fieldset_wrapper [:legend_title] do super(method, collection, value_method, label_method, , ) do |builder| if block_given? yield builder else builder.label { builder. + builder.text } end end end end |
#scopes_select(method, options = {}) ⇒ Object
Wrap the scopes select in a custom fieldset.
45 46 47 48 49 |
# File 'decidim-core/lib/decidim/filter_form_builder.rb', line 45 def scopes_select(method, = {}) fieldset_wrapper [:legend_title] do super(method, ) end end |