Module: Headmin::FilterHelper

Included in:
AdminHelper
Defined in:
app/helpers/headmin/filter_helper.rb

Instance Method Summary collapse

Instance Method Details

#filter_param(name) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/helpers/headmin/filter_helper.rb', line 7

def filter_param(name)
  return nil unless params.has_key?(name)
  if params[name].is_a?(Array)
    params[name].reject { |c| c.empty? }
  else
    params[name]
  end
end

#filter_param_exists?(name) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/helpers/headmin/filter_helper.rb', line 3

def filter_param_exists?(name)
  filter_param(name).present?
end