Class: Railsboot::BlankSlateComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/blank_slate_component.rb

Overview

ViewComponent: renders the blank slate block.

Instance Method Summary collapse

Constructor Details

#initialize(tag: "div", **html_attributes) ⇒ BlankSlateComponent

Returns a new instance of BlankSlateComponent.

Parameters:

  • tag (String) (defaults to: "div")

    HTML tag to render (defaults to div)

  • html_attributes (Hash)

    additional HTML attributes applied to the rendered element

Options Hash (**html_attributes):

  • :class (String)

    additional CSS classes, merged with the component's own classes



13
14
15
16
17
18
19
20
21
# File 'app/components/railsboot/blank_slate_component.rb', line 13

def initialize(tag: "div", **html_attributes)
  @tag = tag
  @html_attributes = html_attributes

  @html_attributes[:class] = class_names(
    "text-center",
    html_attributes.delete(:class)
  )
end