Sha256: 249ff56488c571d7f8267c6819bc12e844d73e6f16f834778bf62a4b9e956b91
Contents?: true
Size: 646 Bytes
Versions: 57
Compression:
Stored size: 646 Bytes
Contents
module AmaLayout class NavigationItemDecorator < Draper::Decorator delegate_all def sub_nav object.sub_nav.map { |sn| sn.decorate } end def sub_nav_class "has-dropdown" if sub_nav.any? end def top_sub_nav h.render partial: "ama_layout/top_sub_nav", locals: { sub_nav: sub_nav } if sub_nav.any? end def sidebar_sub_nav h.render partial: "ama_layout/sub_nav", locals: { sub_nav: sub_nav } if sub_nav.any? end def active_class "activepage" if active_link? end private def active_link? sub_nav.map(&:link).push(link).include? current_url end end end
Version data entries
57 entries across 57 versions & 1 rubygems