Module: Nquery::ComponentsHelper
- Defined in:
- app/helpers/nquery/components_helper.rb
Instance Method Summary collapse
- #nq_card(title: nil, **options, &block) ⇒ Object
- #nq_card_table(columns:, **options, &block) ⇒ Object
- #nq_flash_card(message, type: :notice, **options) ⇒ Object
- #nq_flash_cards(flash: self.flash) ⇒ Object
- #nq_infinite_scroll(url:, **options, &block) ⇒ Object
- #render_nquery_component(component, &block) ⇒ Object
Instance Method Details
#nq_card(title: nil, **options, &block) ⇒ Object
17 18 19 |
# File 'app/helpers/nquery/components_helper.rb', line 17 def nq_card(title: nil, **, &block) CardComponent.new(title: title, **).render_in(self, &block) end |
#nq_card_table(columns:, **options, &block) ⇒ Object
21 22 23 |
# File 'app/helpers/nquery/components_helper.rb', line 21 def nq_card_table(columns:, **, &block) CardTableComponent.new(columns: columns, **).render_in(self, &block) end |
#nq_flash_card(message, type: :notice, **options) ⇒ Object
13 14 15 |
# File 'app/helpers/nquery/components_helper.rb', line 13 def nq_flash_card(, type: :notice, **) render_nquery_component(FlashCardComponent.new(message: , type: type, **)) end |
#nq_flash_cards(flash: self.flash) ⇒ Object
9 10 11 |
# File 'app/helpers/nquery/components_helper.rb', line 9 def nq_flash_cards(flash: self.flash) render_nquery_component(FlashCardsComponent.new(flash: flash)) end |
#nq_infinite_scroll(url:, **options, &block) ⇒ Object
25 26 27 |
# File 'app/helpers/nquery/components_helper.rb', line 25 def nq_infinite_scroll(url:, **, &block) InfiniteScrollComponent.new(url: url, **).render_in(self, &block) end |
#render_nquery_component(component, &block) ⇒ Object
5 6 7 |
# File 'app/helpers/nquery/components_helper.rb', line 5 def render_nquery_component(component, &block) component.render_in(self, &block) end |