Class: Mensa::View::Component

Inherits:
ApplicationComponent show all
Includes:
TablesHelper
Defined in:
app/components/mensa/view/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.



11
12
13
# File 'app/components/mensa/view/component.rb', line 11

def initialize(table)
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



9
10
11
# File 'app/components/mensa/view/component.rb', line 9

def table
  @table
end

Instance Method Details

#model_name_pluralObject

“orders”, “users”, etc. — used in the paging info line.



16
17
18
# File 'app/components/mensa/view/component.rb', line 16

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