class Bootstrap::ViewHelpers::Components::Button::Close

Attributes

dismiss[R]

Public Instance Methods

to_html() click to toggle source
# File lib/bootstrap/view_helpers/components/button/close.rb, line 6
def to_html
  button_tag(html_options) do
    content_tag(:span, '×', aria: { hidden: true })
  end
end

Protected Instance Methods

html_options() click to toggle source
# File lib/bootstrap/view_helpers/components/button/close.rb, line 36
def html_options
  options.merge({ type: :button, data: { dismiss: dismiss } })
end
inject_aria_attributes() click to toggle source
# File lib/bootstrap/view_helpers/components/button/close.rb, line 31
def inject_aria_attributes
  options[:aria] ||= {}
  options[:aria][:label] = 'Fechar'
end
inject_class_name_to_options() click to toggle source
# File lib/bootstrap/view_helpers/components/button/close.rb, line 26
def inject_class_name_to_options
  options[:class] ||= ''
  options[:class] << ' close'
end
inject_data_attributes() click to toggle source
# File lib/bootstrap/view_helpers/components/button/close.rb, line 21
def inject_data_attributes
  super
  @dismiss = options.delete(:dismiss) || 'modal'
end