Module: N::UI
- Defined in:
- lib/n/ui/tabs.rb,
lib/n/ui/popup.rb,
lib/n/ui/select.rb
Defined Under Namespace
Class Method Summary collapse
-
.tabs(request, options, param) ⇒ Object
Render a tabs bar.
Class Method Details
.tabs(request, options, param) ⇒ Object
Render a tabs bar
Example:
#{N::UI.tabs(request, [“Page1”, “Page2”, “Page3”] }
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/n/ui/tabs.rb', line 18 def self.tabs(request, , param) tabs = [] selected = request.get(param, 0) .each_with_index { |opt, idx| if idx == selected tabs << %|<strong>#{opt}</strong>| else tabs << %|<a href="#{request.(param => idx)}">#{opt}</a>| end } return %|<div class="tabs">#{tabs.join('<span class="sep">|</span>')}</div>| end |