PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

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

 May 18, 2022     html, html-table, partial, ruby-on-rails, view     No comments   

Issue

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

the partial: <div><tr><td>foo</td></tr></div>

I'm expecting to see: <table><div><tr><td>foo</td></tr></div></table>

but I'm seeing: <div></div> <table><tr><td>foo</td></tr></table>

why? and how to achieve my expectation?


Solution

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">.



Answered By - Gawyn
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing