Class: Katalyst::Tables::EmptyCaptionComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Katalyst::Tables::EmptyCaptionComponent
- Includes:
- HtmlAttributes
- Defined in:
- app/components/katalyst/tables/empty_caption_component.rb
Overview
:nodoc:
Instance Method Summary collapse
- #clear_filters_path ⇒ Object
- #filtered? ⇒ Boolean
-
#initialize(table, **html_attributes) ⇒ EmptyCaptionComponent
constructor
A new instance of EmptyCaptionComponent.
- #inspect ⇒ Object
- #plural_human_model_name ⇒ Object
- #render? ⇒ Boolean
Constructor Details
#initialize(table, **html_attributes) ⇒ EmptyCaptionComponent
Returns a new instance of EmptyCaptionComponent.
8 9 10 11 12 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 8 def initialize(table, **html_attributes) super(**html_attributes) @table = table end |
Instance Method Details
#clear_filters_path ⇒ Object
22 23 24 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 22 def clear_filters_path url_for end |
#filtered? ⇒ Boolean
18 19 20 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 18 def filtered? @table.collection.respond_to?(:filtered?) && @table.collection.filtered? end |
#inspect ⇒ Object
31 32 33 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 31 def inspect "#<#{self.class.name}>" end |
#plural_human_model_name ⇒ Object
26 27 28 29 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 26 def plural_human_model_name human = @table.model_name&.human || @table.object_name&.to_s&.humanize || "record" human.pluralize.downcase end |
#render? ⇒ Boolean
14 15 16 |
# File 'app/components/katalyst/tables/empty_caption_component.rb', line 14 def render? @table.collection.empty? end |