Module: Decidim::Plans::LinksHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/decidim/plans/links_helper.rb

Instance Method Summary collapse

Instance Method Details

#request_params(extra_params = {}, exclude_params = []) ⇒ Object

This is for generating the links so that they maintain the search status



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/decidim/plans/links_helper.rb', line 7

def request_params(extra_params = {}, exclude_params = [])
  @request_params ||= request.params.except(
    *(exclude_params + [
      :action,
      :component_id,
      :controller,
      :assembly_slug,
      :participatory_process_slug,
      :id
    ])
  ).merge(prepare_extra_params(extra_params))
end

#request_params_query(extra_params = {}, exclude_params = []) ⇒ Object



20
21
22
23
24
# File 'app/helpers/decidim/plans/links_helper.rb', line 20

def request_params_query(extra_params = {}, exclude_params = [])
  return "" unless request_params(extra_params, exclude_params).any?

  "?#{request_params.to_query}"
end