Volkan Volkan - 10 months ago 65
HTML Question

How can I wrap the table trs with divs on rails?


<table><%= render(:partial => 'item') %></table>

the partial:

I'm expecting to see:

but I'm seeing:

why? and how to achieve my expectation?

Answer Source

Wrapping tds and trs in divs is incorrect. If you want to add some css or mark a particular td for Capybara, you can use the id or class property inside the td. Something like <td id="td_id" class="td_class">.