Forum: Ruby on Rails Rails/Ajax question from a newbie (to both)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6924d3c3526c4cf23250edd56c9abc56?d=identicon&s=25 Rakesh Malik (Guest)
on 2005-12-27 22:37
(Received via mailing list)
I'm trying to get a Rico LiveGrid working, and I am a bit stuck on how
to
accomplish this.

I have a page that successfully queries a controller and updates a <div>
containing a table. I have two
versions of the action; one uses the render_partial to return a rendered
version of that table, and the
other returns an XML-RPC document, and this is where I hit a snag.

The Rico LiveGrid tutorial describes the XML schema it's looking for,
and
it's clearly not what I'm getting
from the XML-RPC partial.

What I have looks like this:
<methodResponse>
 <params>
  <param>
   <value>
    <array>
     <data>
     <value>
      <struct>
       <member>
        <name>field1</name>
        <value>
.
.
.

It does have the <xml version... /> tag at the top, btw.

It works fine with the code I have in the partial:
<% @results.each do |item| %>
     <tr>
    <td class="cell"> <%= item.field1 %>
        <td>
    <td class="cell"> <%= item.field2 %>
        <td>
    <td class="cell"> <%= item.field3 %>
        <td>
     </tr>
<% end %>

And the LiveGrid tutorial describes this:
<ajax-response>
 <response type='object' id='data_grid_updater'>
  <rows update_us='true>
    <tr...

The rest is the table and closing tags. Of course, if you're experienced
with this stuff, you've probably
already seen that. :)

What's the best way to handle this issue? Should I modify the xml_rpc
partial?

Thanks!

-Rakesh

(The book recommened on the Rico site is on order and hasn't shipped
yet.)
6924d3c3526c4cf23250edd56c9abc56?d=identicon&s=25 Rakesh Malik (Guest)
on 2005-12-27 23:10
(Received via mailing list)
Ok, replying to myself... but I think that the process of writing this
question helped, so I guess
it succeeded, but I was just missing the obvious approach of coding the
XML
tags into the
partial. (Duh.)

Thanks!

-Rakesh
This topic is locked and can not be replied to.