Class: Aureus::Components::ToolbarDropdown
Instance Method Summary
collapse
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
Returns a new instance of ToolbarDropdown.
85
86
87
88
|
# File 'lib/aureus/components/toolbar.rb', line 85
def initialize(title)
@title = title
@items = Array.new
end
|
Instance Method Details
#divider ⇒ Object
98
99
100
|
# File 'lib/aureus/components/toolbar.rb', line 98
def divider
@items << ToolbarDivider.new
end
|
#info(text) ⇒ Object
94
95
96
|
# File 'lib/aureus/components/toolbar.rb', line 94
def info(text)
@items << ToolbarInfo.new(text,1)
end
|
#link_to(text, url, *args) ⇒ Object
90
91
92
|
# File 'lib/aureus/components/toolbar.rb', line 90
def link_to(text, url, *args)
@items << ToolbarButton.new(text,1,url,args)
end
|
#render ⇒ Object
102
103
104
105
106
|
# File 'lib/aureus/components/toolbar.rb', line 102
def render
title = content_tag 'span', @title, class: 'dropdown-accessor'
list = content_tag 'ul', compact_render(*@items), class: 'dropdown-inner'
content_tag 'li', title+list, class: 'dropdown-outer'
end
|