Class: Mensa::EmptyState::Component

Inherits:
ApplicationComponent show all
Defined in:
app/components/mensa/empty_state/component.rb

Instance Attribute Summary collapse

Attributes inherited from ApplicationComponent

#original_view_context

Instance Method Summary collapse

Constructor Details

#initialize(table:) ⇒ Component

Returns a new instance of Component.



8
9
10
# File 'app/components/mensa/empty_state/component.rb', line 8

def initialize(table:)
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



6
7
8
# File 'app/components/mensa/empty_state/component.rb', line 6

def table
  @table
end

Instance Method Details

#model_name_pluralObject

“orders”, “users”, etc. — used inside the translated heading.



13
14
15
# File 'app/components/mensa/empty_state/component.rb', line 13

def model_name_plural
  table.model.model_name.human.pluralize.downcase
end