Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
Turning an auto-expanding table row into a 'click to expand' row

I have a tablecompiled in Slim, which displays incoming messages in a row called 'events'.

My current issue is that this row automatically adjusts to expand to account for long messages, which creates a lopsided look if every 3rd message for example is quite long, but the rest are approximately one line of text.

I want to change this so that any string longer than 30 characters only displays the first line, and expands (aka reverts to it current format) upon clicking the row.

I however, can't think of the best way to approach this, and don't want to over-engineer a solution. What path would you suggest to achieve this?

table.slim

table.table.table-striped
thead.bg-white
  tr
    th = t('panel.home.show.event')
tbody.activities
  - @activities.each do |activity|
    tr
      - activity_cell = cell(:activity, activity)
      td.event
        == activity_cell.subtitle
        - if activity.deleted_by_slug.present?
          code == link_to(activity.deleted_by_slug, activity_cell.path(:deleted_by_slug))
      td
        == activity_cell.state
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda