Class: ActiveAction::BootstrapDropdown
- Defined in:
- lib/active_action/bootstrap_dropdown.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(label:, actions:) ⇒ BootstrapDropdown
constructor
A new instance of BootstrapDropdown.
- #to_html ⇒ Object
Constructor Details
#initialize(label:, actions:) ⇒ BootstrapDropdown
Returns a new instance of BootstrapDropdown.
8 9 10 11 |
# File 'lib/active_action/bootstrap_dropdown.rb', line 8 def initialize(label:, actions:) @label = label @actions = actions end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
7 8 9 |
# File 'lib/active_action/bootstrap_dropdown.rb', line 7 def actions @actions end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'lib/active_action/bootstrap_dropdown.rb', line 7 def label @label end |
Class Method Details
.to_html(label:, actions:) ⇒ Object
3 4 5 |
# File 'lib/active_action/bootstrap_dropdown.rb', line 3 def self.to_html(label:, actions:) new(label: label, actions: actions).to_html end |
Instance Method Details
#to_html ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/active_action/bootstrap_dropdown.rb', line 13 def to_html capture do content_tag(:div, class: "dropdown") do concat dropdown_tag(label) concat dropdown_for(actions) end end end |