Class: Aureus::Components::ToolbarSection
Instance Method Summary
collapse
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
Returns a new instance of ToolbarSection.
27
28
29
30
|
# File 'lib/aureus/components/toolbar.rb', line 27
def initialize(position)
@items = Array.new
@position = position
end
|
Instance Method Details
#dropdown(title) {|toolbar| ... } ⇒ Object
36
37
38
39
40
|
# File 'lib/aureus/components/toolbar.rb', line 36
def dropdown(title)
toolbar = ToolbarDropdown.new(title)
yield toolbar
@items << toolbar
end
|
#info(text) ⇒ Object
42
43
44
|
# File 'lib/aureus/components/toolbar.rb', line 42
def info(text)
@items << ToolbarInfo.new(text,0)
end
|
#link_to(text, url, *args) ⇒ Object
32
33
34
|
# File 'lib/aureus/components/toolbar.rb', line 32
def link_to(text, url, *args)
@items << ToolbarButton.new(text, 0, url, args)
end
|
#render ⇒ Object
46
47
48
|
# File 'lib/aureus/components/toolbar.rb', line 46
def render
content_tag 'ul', compact_render(*@items), class: @position
end
|