Module: ControlCenter::Helpers::LayoutHelper
- Defined in:
- lib/control_center/helpers/layout_helper.rb
Instance Method Summary collapse
- #current_sub_tab ⇒ Object
- #current_tab ⇒ Object
- #select_sub_tab(tab) ⇒ Object
- #select_tab(tab) ⇒ Object
-
#sidebar ⇒ Object
Sets up a sidebar in control center.
- #sidebar? ⇒ Boolean
- #sub_tab(tab_name, tab_url) ⇒ Object
- #sub_tabs ⇒ Object
- #tab(tab_name, tab_url) ⇒ Object
- #title(title) ⇒ Object
Instance Method Details
#current_sub_tab ⇒ Object
30 31 32 |
# File 'lib/control_center/helpers/layout_helper.rb', line 30 def current_sub_tab @cc_current_sub_tab end |
#current_tab ⇒ Object
15 16 17 |
# File 'lib/control_center/helpers/layout_helper.rb', line 15 def current_tab @cc_current_tab end |
#select_sub_tab(tab) ⇒ Object
27 28 29 |
# File 'lib/control_center/helpers/layout_helper.rb', line 27 def select_sub_tab(tab) @cc_current_sub_tab = tab end |
#select_tab(tab) ⇒ Object
12 13 14 |
# File 'lib/control_center/helpers/layout_helper.rb', line 12 def select_tab(tab) @cc_current_tab = tab end |
#sidebar ⇒ Object
Sets up a sidebar in control center.
35 36 37 38 39 40 41 42 |
# File 'lib/control_center/helpers/layout_helper.rb', line 35 def if block_given? @sidebar_set = true content_for :sidebar do yield end end end |
#sidebar? ⇒ Boolean
44 45 46 |
# File 'lib/control_center/helpers/layout_helper.rb', line 44 def @sidebar_set ||= false end |
#sub_tab(tab_name, tab_url) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/control_center/helpers/layout_helper.rb', line 56 def sub_tab(tab_name, tab_url) = {} [:class] = "active" if current_sub_tab == tab_name content_tag "li", , true do link_to tab_name, tab_url end end |
#sub_tabs ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/control_center/helpers/layout_helper.rb', line 19 def sub_tabs if block_given? content_for :sub_tabs do yield end end end |
#tab(tab_name, tab_url) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/control_center/helpers/layout_helper.rb', line 48 def tab(tab_name, tab_url) = {} [:class] = "active" if current_tab == tab_name content_tag "li", , true do link_to tab_name, tab_url end end |
#title(title) ⇒ Object
8 9 10 |
# File 'lib/control_center/helpers/layout_helper.rb', line 8 def title(title) @control_center_title = title end |