Class: DropdownHelper::DropdownCreator
- Inherits:
-
Object
- Object
- DropdownHelper::DropdownCreator
- Includes:
- ActionView::Helpers, ButtonHelper, FormatHelper
- Defined in:
- app/helpers/dropdown_helper.rb
Instance Attribute Summary collapse
-
#btn_group_options ⇒ Object
Returns the value of attribute btn_group_options.
-
#content ⇒ Object
Returns the value of attribute content.
-
#list ⇒ Object
Returns the value of attribute list.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
Instance Method Summary collapse
-
#initialize(content, list, options) ⇒ DropdownCreator
constructor
A new instance of DropdownCreator.
- #render ⇒ Object
Methods included from ButtonHelper
#button, #button_group, #button_toolbar, #navbar_button
Methods included from FormatHelper
#prepend_class, #squeeze_n_strip
Constructor Details
#initialize(content, list, options) ⇒ DropdownCreator
Returns a new instance of DropdownCreator.
45 46 47 48 49 50 |
# File 'app/helpers/dropdown_helper.rb', line 45 def initialize(content, list, ) @content = content @list = list @options = @btn_group_options = .delete(:btn_group_html) || {} end |
Instance Attribute Details
#btn_group_options ⇒ Object
Returns the value of attribute btn_group_options.
42 43 44 |
# File 'app/helpers/dropdown_helper.rb', line 42 def @btn_group_options end |
#content ⇒ Object
Returns the value of attribute content.
39 40 41 |
# File 'app/helpers/dropdown_helper.rb', line 39 def content @content end |
#list ⇒ Object
Returns the value of attribute list.
40 41 42 |
# File 'app/helpers/dropdown_helper.rb', line 40 def list @list end |
#options ⇒ Object
Returns the value of attribute options.
41 42 43 |
# File 'app/helpers/dropdown_helper.rb', line 41 def @options end |
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
43 44 45 |
# File 'app/helpers/dropdown_helper.rb', line 43 def output_buffer @output_buffer end |
Instance Method Details
#render ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'app/helpers/dropdown_helper.rb', line 52 def render , btn_id, align, direction, size, type = () = (content, size, type, btn_id, ) = (btn_id, align) tag = ? :li : :div prepend_class(, 'btn-group', (direction == :up ? 'dropup' : 'dropdown')) content_tag tag, do ((.deep_merge()) + dropdown_list(list, )).html_safe end end |