This took me some time. The problem was occurring only on https, not on http. So ruby code, gems, and versions seemed to be fine.
= A simple persistent collapse/expand toggle with jquery = I’m maintaining a legacy project and rewrote this piece recently. it was originally written about a decade ago. jQuery is still available in the environment and no decision has been made to move this piece to React, so we’ll use jQuery.