Class: SearchResults::Models
- Inherits:
-
Components::Base
- Object
- Components::Base
- SearchResults::Models
- Includes:
- Phlex::Rails::Helpers::LinkTo, Phlex::Rails::Helpers::TurboFrameTag
- Defined in:
- app/components/databasium/search_results/models.rb
Instance Method Summary collapse
-
#initialize(models:, pagy:) ⇒ Models
constructor
A new instance of Models.
- #view_template ⇒ Object
Constructor Details
#initialize(models:, pagy:) ⇒ Models
Returns a new instance of Models.
9 10 11 12 |
# File 'app/components/databasium/search_results/models.rb', line 9 def initialize(models:, pagy:) @models = models @pagy = pagy end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/components/databasium/search_results/models.rb', line 14 def view_template turbo_frame_tag("results") do @models&.each do |model| link_to( databasium.model_path(model), data: { turbo_frame: "main" }, class: "text-main-text hover:text-hover hover:cursor-pointer flex items-center gap-2 p-1 border-b border-border flex items-center justify-between" ) do p(class: "max-w-fit overflow-x-auto me-2 scrollbar-thin p-1") do "#{model.upcase_first}" end end end div(class: "mt-4 flex justify-start") { raw @pagy.series_nav.html_safe } if @pagy end end |