Module: Trestle::NavigationHelper

Defined in:
app/helpers/trestle/navigation_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_admin?(admin) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/helpers/trestle/navigation_helper.rb', line 7

def current_admin?(admin)
  respond_to?(:admin) && self.admin && self.admin.name == admin.name
end

#current_navigation_item?(item) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/helpers/trestle/navigation_helper.rb', line 3

def current_navigation_item?(item)
  current_page?(item.path) || (item.admin && current_admin?(item.admin))
end