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.
31
32
33
34
|
# File 'lib/aureus/components/toolbar.rb', line 31
def initialize position
@items = Array.new
@position = position
end
|
Instance Method Details
#dropdown(title) {|toolbar| ... } ⇒ Object
40
41
42
43
44
|
# File 'lib/aureus/components/toolbar.rb', line 40
def dropdown title
toolbar = ToolbarDropdown.new(title)
yield toolbar
@items << toolbar
end
|
#info(text) ⇒ Object
46
47
48
|
# File 'lib/aureus/components/toolbar.rb', line 46
def info text
@items << ToolbarInfo.new(text,0)
end
|
#link_to(text, url, *args) ⇒ Object
36
37
38
|
# File 'lib/aureus/components/toolbar.rb', line 36
def link_to text, url, *args
@items << ToolbarButton.new(text,0,url,args)
end
|
#render ⇒ Object
50
51
52
|
# File 'lib/aureus/components/toolbar.rb', line 50
def render
content_tag 'ul', compact_render(*@items), class: @position
end
|