Module: LinkHelper

Included in:
ArtfullyOseHelper
Defined in:
app/helpers/link_helper.rb

Instance Method Summary collapse

Instance Method Details

#active?(section) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
# File 'app/helpers/link_helper.rb', line 2

def active?(section)
  "active" if content_for(:_active_section) == section.to_s || content_for(:_active_sub_section) == section.to_s
end


18
19
20
21
22
23
# File 'app/helpers/link_helper.rb', line 18

def active_link_to(text, url='#', condition=nil)
  if condition.nil? and String === url
    condition = url == request.path
  end
   :li, link_to(text, url), :class => (condition && 'active')
end

#active_sectionObject



6
7
8
# File 'app/helpers/link_helper.rb', line 6

def active_section
  content_for(:_active_section)
end

#in_section(section) ⇒ Object



10
11
12
# File 'app/helpers/link_helper.rb', line 10

def in_section(section)
  content_for(:_active_section, section)
end

#in_sub_section(section) ⇒ Object



14
15
16
# File 'app/helpers/link_helper.rb', line 14

def in_sub_section(section)
  content_for(:_active_sub_section, section)
end