Module: SidebarHelper

Defined in:
app/helpers/sidebar_helper.rb

Instance Method Summary collapse

Instance Method Details

#active_li?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/sidebar_helper.rb', line 3

def active_li?(options = {})
  result = false
  return '' if options[:controllers].blank?
  options[:value] ||= ''
  unless options[:actions].blank?
    result = true if options[:controllers].include?(controller_name) and options[:actions].include?(action_name)
  else
    result = true if options[:controllers].include?(controller_name)
  end
  result = "#{options[:value]}" if result.present?
end