Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!