Module: Decidim::Admin::SearchFormHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/decidim/admin/search_form_helper.rb
Overview
Overrides some methods from Ransack::Helpers::FormHelper to fix the search user interfaces within Decidim.
Instance Method Summary collapse
-
#search_form_for(record, options = {}) ⇒ Object
Provide the correct builder option for the admin search forms.
- #sort_link(search_object, attribute, *args) ⇒ Object
Instance Method Details
#search_form_for(record, options = {}) ⇒ Object
Provide the correct builder option for the admin search forms. Otherwise they would be generated using Ransack::Helpers::FormHelper which does not provide all the same features that the Decidim form builders, such as datetime pickers.
12 13 14 15 16 17 |
# File 'app/helpers/decidim/admin/search_form_helper.rb', line 12 def search_form_for(record, = {}, &) [:builder] ||= SearchFormBuilder [:url] = url_for(params.to_unsafe_h.except("locale", :locale).merge(locale: nil)) if [:url].blank? super end |
#sort_link(search_object, attribute, *args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/helpers/decidim/admin/search_form_helper.rb', line 19 def sort_link(search_object, attribute, *args, &) = args. = .merge(params: sort_link_params) args << super end |