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.
97
98
99
100
|
# File 'lib/aureus/components/toolbar.rb', line 97
def initialize title
@title = title
@items = Array.new
end
|
Instance Method Details
#divider ⇒ Object
110
111
112
|
# File 'lib/aureus/components/toolbar.rb', line 110
def divider
@items << ToolbarDivider.new
end
|
#info(text) ⇒ Object
106
107
108
|
# File 'lib/aureus/components/toolbar.rb', line 106
def info text
@items << ToolbarInfo.new(text,1)
end
|
#link_to(text, url, *args) ⇒ Object
102
103
104
|
# File 'lib/aureus/components/toolbar.rb', line 102
def link_to text, url, *args
@items << ToolbarButton.new(text,1,url,args)
end
|
#render ⇒ Object
114
115
116
117
118
|
# File 'lib/aureus/components/toolbar.rb', line 114
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
|