Sha256: b0def7017d267e4720fcb363512fdc90a9bd9484cfd0c0c74b83497d36364eb6

Contents?: true

Size: 758 Bytes

Versions: 53

Compression:

Stored size: 758 Bytes

Contents

module PgAssociable
  module Helpers
    MAX_RESULTS = 8

    def pg_respond_abrir_modal
      respond_to do |format|
        format.turbo_stream do
          render turbo_stream: turbo_stream.append_all('body', partial: 'pg_associable_modal')
        end
      end
    end

    def pg_respond_buscar
      partial = 'pg_associable/resultados_inline'
      resultados_prefix = 'resultados-inline'
      query = params[:query]
      timeout_id = params[:timeout_id]
      @collection = policy_scope(@clase_modelo).kept.query(query).limit(MAX_RESULTS)
      render turbo_stream:
        turbo_stream.update("#{resultados_prefix}-#{params[:id]}",
                            partial:, locals: { collection: @collection, query:, timeout_id: })
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
pg_rails-7.2.3 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.2.2 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.2.1 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.2.0 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.16 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.15 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.14 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.13 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.12 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.11 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.10 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.9 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.8 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.7 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.6 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.5 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.4 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.3 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.2 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.1.1.pre.6 pg_associable/app/helpers/pg_associable/helpers.rb