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.0.8.pre.alpha.98 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.97 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.96 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.95 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.94 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.93 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.92 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.91 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.90 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.89 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.88 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.87 pg_associable/app/helpers/pg_associable/helpers.rb
pg_rails-7.0.8.pre.alpha.86 pg_associable/app/helpers/pg_associable/helpers.rb