Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#side_nav_li(text, path, icon = nil) ⇒ Object


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

def side_nav_li(text, path, icon=nil)
  (:li) do   
    options = current_page?(path) ? { class: "active" } : {}
    if icon
      link_to path, options do                           
        "<i class='#{icon} sidebar-nav-icon'></i><span class='sidebar-nav-mini-hide'>#{text}</span>".html_safe
      end 
    else
      link_to(text, path, options)
    end
  end
end

#top_nav_dropdown_li(text, path, icon = nil) ⇒ Object


25
26
27
28
29
30
31
# File 'app/helpers/application_helper.rb', line 25

def top_nav_dropdown_li(text, path, icon=nil)
  (:li) do                                      
    link_to path do  
      (:i, nil, { class: "#{icon} fa-fw pull-right" }) + text                             
    end                                                            
  end
end

#top_nav_li(text, path, icon = nil) ⇒ Object


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

def top_nav_li(text, path, icon=nil)
  (:li) do 
    options = current_page?(path) ? { class: "active" } : {}
    link_to path, options do                           
      "<i class='#{icon}'></i><strong>#{text.upcase}</strong>".html_safe
    end     
  end
end