class UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink

Create DropdownLink

This element is an extend of UiBibz::Ui::Core::Component.

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

UiBibz::Ui::Core::Forms::DropdownLink.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Forms::DropdownLink.new(options = nil, html_options = nil) do
  content
end
UiBibz::Ui::Core::Forms::DropdownLink.new('Home', { glyph: 'home', state: :active, url: '#home', link_html_options: { class: 'link1' }},{ class: 'test' }).render

UiBibz::Ui::Core::Forms::DropdownLink.new({ glyph: { name: 'eye', size: 3 }, url: '#home' }, { class: 'test' }) do
  'Home'
end.render

Public Class Methods

new(content = nil, options = nil, html_options = nil, &block) click to toggle source

See UiBibz::Ui::Core::Component.initialize

Calls superclass method UiBibz::Ui::Core::Component::new
# File lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb, line 45
def initialize(content = nil, options = nil, html_options = nil, &block)
  super
  @html_options = @html_options.merge(link_html_options)
end

Public Instance Methods

pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb, line 51
def pre_render
  link_to glyph_and_content_html, link_url, html_options
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb, line 57
def component_html_classes
  'dropdown-item'
end