Sha256: b4e61effdaab6ac2ce1c0fca66670469859b9b7b8ebec91310766abb129196ba
Contents?: true
Size: 752 Bytes
Versions: 14
Compression:
Stored size: 752 Bytes
Contents
module LinkHelper def active?(section) "active" if content_for(:_active_section) == section.to_s || content_for(:_active_sub_section) == section.to_s end def in_section?(section) "in" if content_for(:_active_section) == section.to_s || content_for(:_active_sub_section) == section.to_s end def active_section content_for(:_active_section) end def in_section(section) content_for(:_active_section, section) end def in_sub_section(section) content_for(:_active_sub_section, section) end def active_link_to(text, url='#', condition=nil) if condition.nil? and String === url condition = url == request.path end content_tag :li, link_to(text, url), :class => (condition && 'active') end end
Version data entries
14 entries across 14 versions & 1 rubygems