Hey all,

I have some problems creating a rendered xml file

this is my source

  def show_friends
    @profile = Profile.find(user)
      @list = @profile.send('friends').find(:all, :limit => 20, :order
=> 'RAND()')
      @checkin = Checkin.find(:last, :conditions => {:profile_id =>
@list})
      @place = @checkin.place
    respond_to do |format|
          format.html {render}
          format.xml  { render :xml => @list.to_xml(:dasherize =>
false)}
        end
  end

And this give as output

<profile>
<login>wouter</login>
<password>*</password>
...
</profile>

What i want to do now is include the @place object in my xml

so like this:

<profile>
<login>wouter</login>
<password>*</password>
  <place>
    <latitude>... </latitude>
    ..
   </place>
</profile>

I know i can do :include => [:place] but this include all the places
from that person. I only want to get the last place where the user
checked in (      @checkin = Checkin.find(:last, :conditions =>
{:profile_id => @list})
      @place = @checkin.place) . So i really have to include this, but
I have tried many things but nothing works.

How can i do this?

Thank you,

Wouter
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to