Module: Trestle::TabHelper
- Defined in:
- app/helpers/trestle/tab_helper.rb
Instance Method Summary collapse
Instance Method Details
#tab(name, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/trestle/tab_helper.rb', line 7 def tab(name, ={}) tabs[name] = tab = Tab.new(name, ) content_tag(:div, id: tab.id(("modal" if dialog_request?)), class: ["tab-pane", ('active' if name == tabs.keys.first)], role: "tabpanel") do if block_given? yield elsif [:partial] render partial: [:partial] else render partial: name.to_s end end end |
#tabs ⇒ Object
3 4 5 |
# File 'app/helpers/trestle/tab_helper.rb', line 3 def tabs @_trestle_tabs ||= {} end |