Hi, I seem to be having an issue with rendering a partial within a table. Basically, I had a partial with all my <tr> and <td> tags that was to be rendered inside the <table> 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 <table> 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 <tr>''s and even <td>''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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 16 Apr 2008, at 17:06, Mark Mr wrote:> > Hi, I seem to be having an issue with rendering a partial within a > table. Basically, I had a partial with all my <tr> and <td> tags that > was to be rendered inside the <table> 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 <table> 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? >I can''t think why the two would conflict. Show us some code :-), and eyeball the generated html closely. Fred> The other potential reason is I''m using scriptaculous and ajax for all > of these. I tried giving all my <tr>''s and even <td>''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! > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung 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. > > FredOk, here''s the table where it''s supposed to be inserted: <table> <tr> <td>Description</td> </tr> <tr> <td><%=text_field_tag :description, '''', :size => ''13'' %> <%= observe_field(:description, :frequency=>0.1, :update=>"hardware_list", :url=>{:action=>:get_description_list})%></td> </tr> <div id="hardware_list"></div> #insert partial here </table> 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 %> <tr> <td><%= link_to hardware.description, hardware %></td> </tr> <% end %> the partial is renders and displays everything minus the table tags. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 16, 6:58 pm, Mark Mr <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> <table> > > <tr> > <td>Description</td> > </tr> > <tr> > <td><%=text_field_tag :description, '''', :size => ''13'' %> > <%= observe_field(:description, :frequency=>0.1, > :update=>"hardware_list", :url=>{:action=>:get_description_list})%></td> > </tr> > > <div id="hardware_list"></div> #insert partial here > > </table>Having a div at the top level of a table like that is invalid html Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Apr 16, 6:58�pm, Mark Mr <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> <div id="hardware_list"></div> #insert partial here >> >> </table> > Having a div at the top level of a table like that is invalid html > > Fredyeah you''re right. I think that will solve my problem here, I''ve gotten s couple things to work. I''ll just set a <tr> with the id instead of a div. Thanks, i didnt know that! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 16, 9:35 pm, Mark Mr <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 <tr> with the id instead of a > div. Thanks, i didnt know that! > --You''re allowed multiple tbodys though, so you can do <table> <tbody> static rows here </tbody> <tbody id="hardware_list"> </tbody> </table> and insert your rows into that second tbody. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Apr 16, 9:35�pm, Mark Mr <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 <tr> with the id instead of a >> div. Thanks, i didnt know that! >> -- > > You''re allowed multiple tbodys though, so you can do > <table> > <tbody> > static rows here > </tbody> > <tbody id="hardware_list"> </tbody> > </table> > and insert your rows into that second tbody. > > FredAh 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---