# Problem rendering within a table

**URL:** <https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967>\
**Category:** Rails\
**Created:** [April 16, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967 "2008-04-16T18:06:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 6:06pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/1 "2008-04-16T18:06:53Z")

</div>

Hi, I seem to be having an issue with rendering a partial within a  
table. Basically, I had a partial with all my

 and tags that  
was to be rendered inside the tags on my page. When it rendered,  
all the tags were removed for some reason and just the text remained, so  
it went outside my table. However, when I include the 

 tags  
inside the partial, it renders everything just fine. I believe the  
problem is with my acts\_as\_authenticated plugin, as I remember getting  
an authentication error at one point. Does anyone know if that plugin  
has a problem with inserting a partial into a table?

The other potential reason is I’m using scriptaculous and ajax for all  
of these. I tried giving all my

's and even 

| 's unique IDs but  
that didnt work either. If anyone has a suggestion or has run into this  
problem before I’d love to know. I just want to be able to update within  
a table with ajax. Thanks! |

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/2 "2008-04-16T18:37:57Z")

</div>

On 16 Apr 2008, at 17:06, Mark Mr wrote:

> an authentication error at one point. Does anyone know if that plugin  
> has a problem with inserting a partial into a table?

I can’t think why the two would conflict. Show us some code :-), and  
eyeball the generated html closely.

Fred

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/3 "2008-04-16T19:58:08Z")

</div>

Frederick C. wrote:

> On 16 Apr 2008, at 17:06, Mark Mr wrote:
> 
> > an authentication error at one point. Does anyone know if that plugin  
> > has a problem with inserting a partial into a table?
> 
> I can’t think why the two would conflict. Show us some code :-), and  
> eyeball the generated html closely.
> 
> Fred

Ok, here’s the table where it’s supposed to be inserted:

 #insert partial here

| Description |
| \<%=text\_field\_tag :description, '', :size =\> '13' %\> \<%= observe\_field(:description, :frequency=\>0.1, :update=\>"hardware\_list", :url=\>{:action=\>:get\_description\_list})%\> |

the controller function(get\_description\_list) runs some stuff and ends  
up with:

render :partial =\> ‘index\_search\_by\_desc’, :locals =\> { :hardwares =\>  
@hardwares }

then this is the partial it renders:

\<% for hardware in hardwares %\>

 \<%= link\_to hardware.description, hardware %\> \<% end %\>

the partial is renders and displays everything minus the table tags.

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/4 "2008-04-16T20:57:35Z")

</div>

On Apr 16, 6:58 pm, Mark Mr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> #insert partial here

Having a div at the top level of a table like that is invalid html

Fred

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/5 "2008-04-16T22:44:09Z")

</div>

On Apr 16, 9:35 pm, Mark Mr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Having a div at the top level of a table like that is invalid html
> 
> > Fred
> 
> ## yeah you’re right. I think that will solve my problem here, I’ve gotten s couple things to work. I’ll just set a with the id instead of a div. Thanks, i didnt know that!

You’re allowed multiple tbodys though, so you can do

static rows here

 
and insert your rows into that second tbody.

Fred

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/6 "2008-04-16T22:35:58Z")

</div>

Frederick C. wrote:

> On Apr 16, 6:58ï¿½pm, Mark Mr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > #insert partial here
> 
> Having a div at the top level of a table like that is invalid html
> 
> Fred

yeah you’re right. I think that will solve my problem here, I’ve gotten  
s couple things to work. I’ll just set a with the id instead of a  
div. Thanks, i didnt know that!

---

<div class="post-metadata">

**Author:** ![pimeamark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9e8a1a/32.png) [@pimeamark](https://www.ruby-forum.com/u/pimeamark)\
**Post date:** [April 16, 2008, 11:15pm UTC](https://www.ruby-forum.com/t/problem-rendering-within-a-table/134967/7 "2008-04-16T23:15:34Z")

</div>

Frederick C. wrote:

> On Apr 16, 9:35ï¿½pm, Mark Mr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > Having a div at the top level of a table like that is invalid html
> > 
> > > Fred
> > 
> > ## yeah you’re right. I think that will solve my problem here, I’ve gotten s couple things to work. I’ll just set a with the id instead of a div. Thanks, i didnt know that!
> 
> You’re allowed multiple tbodys though, so you can do
> 
> static rows here
> 
>  
> and insert your rows into that second tbody.
> 
> Fred

Ah yeah that works too. that’ll sure be useful in the future. I really  
appreciate the pointers there 🙂 now my ajax is working pretty good.
