Having trouble with link breaks in a table

I have table being filled by a partial. When the fields are filled,
the fields end up together or not there for half a page. See below. My
controller code and views are below…

@single = Array.new
for @h in households do
if @h.people.count == 1
@single << @h


<%= render :partial=>"christmas", :collection => @single %>
Single Families


<%= h(christmas.name) %>

The output is:

Single Families
Amanda Axxrn
Paula xxxk
Michael BxxxxRxxond Baxxt
Carl Lxxxe Bexx
Robert BxxxxxrdBetsy xxxxxuJason BrxxxnKeith Bxxxn
Frances Brxxxle
Edward BxxxkDoris BxxxrThomas CxxxllEdith Cxxxxy
Sandra DxxxxxtSuzanne DxxxxxultJoyce Dxxxk
Frances Dxxxxn
Barbara DxxxdyRita DxxxxinVirginia Dxxxis
Donald Exxxy
Lorraine ExxxxElsie FxxxufEvelyn Fxxxnd
Patricia Fxxxxy
Romeo Fxxx
Cheryl FxxerAlice Frxxxe

Rita Gxxs

Bob S. wrote:


<%= render :partial=>"christmas", :collection => @single %>
Single Families

Perhaps something like:

<%= render :partial => "christmas", :collection => @single %>
Single Families

On 26 August 2010 07:38, Bob S. [email protected] wrote:


<%= h(christmas.name) %> [...]

Firstly have a look at the generated html (View, Page Source or
similar in the browser) and see if it is what you expect. If it looks
ok then copy and paste it into the w3c html validator (google for it)
to check it is valid. See if that shows anything.

I am not sure what the tag is for there.


On Aug 26, 9:21 am, Ar Chron [email protected] wrote:

<%= render :partial => "christmas", :collection => @single %>
Single Families
-- Posted viahttp://www.ruby-forum.com/.

No change. It uses the top half of the page to print, then skips the
bottom half. Still doesn’t use the cell size either.
Another table in the same controller action and same view works fine.
While I was messing with this, the only thing
that made the cells line up with no skips was to put the name field
three times so it used the entire width of the page.
Hope this helps.



I wonder if internally (in Rails) something is getting confused between
your view name (christmas.html.erb) and the partial name

What if you rename your partial to something like

And if there is another table in the same view, it might be that your
generated html is not closing properly before attempting to generate the
christmas table…

Feel free to post the view in its entirety, because the solution
should be relatively simple.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs