Class: SearchResults::Tables
- Inherits:
-
Components::Base
- Object
- Components::Base
- SearchResults::Tables
- Includes:
- Phlex::Rails::Helpers::LinkTo, Phlex::Rails::Helpers::TurboFrameTag
- Defined in:
- app/components/databasium/search_results/tables.rb
Instance Method Summary collapse
-
#initialize(tables:, pagy:) ⇒ Tables
constructor
A new instance of Tables.
- #view_template ⇒ Object
Constructor Details
#initialize(tables:, pagy:) ⇒ Tables
Returns a new instance of Tables.
9 10 11 12 |
# File 'app/components/databasium/search_results/tables.rb', line 9 def initialize(tables:, pagy:) @tables = tables @pagy = pagy end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/components/databasium/search_results/tables.rb', line 14 def view_template turbo_frame_tag("results") do @tables&.each do |table| div(class: "border-b-2 border-b-border py-2 px-3") do link_to "#{table}", databasium.records_records_path(table: table, refresh: true), data: { turbo_frame: "_top", turbo_stream: true } end end div(class: "mt-4 flex justify-start") { raw @pagy.series_nav.html_safe } if @pagy end end |