I have the following table row with embedded ruby:
<tr class=<%= "image-carousel-show thumb-#{index}" %>>
Which creates this:
<tr class="image-carousel-show" thumb-0="">
However, I want the thumb-0 to be in the class of the row, not as it's own attribute like it currently is.
This is what I want it to show up as:
<tr class="image-carousel-show thumb-0">
I'm not sure why it's doing this, in the ERB I have it all as one string so I don't know why it's being outputted as two.
This is not done by erb but it is modified by the browser, as those params are not placed within quotes. Try:
<tr class="<%= "image-carousel-show thumb-#{index}" %>">
Also there is absolutely no sense of having both classes within erb. This will do the same and is slightly more readable.
<tr class="image-carousel-show thumb-<%= index %>">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With