class Bootstrap4RailsComponents::Bootstrap::Components::Dropdown

Bootstrap Dropdown Component getbootstrap.com/docs/4.1/components/dropdowns/

Public Instance Methods

button() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 11
def button
  options.fetch(:button, '')
end
component_family() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 15
def component_family
  :dropdown
end
offset() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 19
def offset
  options.fetch(:offset, '')
end
render() { |: body)| ... } click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 27
def render
  super do
    capture do
      if button.present?
        concat(Bootstrap4RailsComponents::Bootstrap::Components::DropdownToggle.new({ body: button, theme: theme, as: :button, offset: offset }, view_context).render)
      end
      concat(block_given? ? yield : body)
    end
  end
end
theme() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 23
def theme
  options.fetch(:theme, Bootstrap4RailsComponents::DEFAULT_BOOTSTRAP_THEME)
end

Private Instance Methods

non_html_attribute_options() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/dropdown.rb, line 40
def non_html_attribute_options
  super.push(:theme,
             :button,
             :offset,
             :dropleft,
             :dropright,
             :dropup)
end