On 14 aug, 18:21, Colin Law <clan...@googlemail.com> wrote:
> 2009/8/14 Wouter <wouterg...@gmail.com>:
>
>
>
> >> Do you *really* think that bumping after less than 24 hours will get
> >> people to help you? (Hint: it won't.)
>
> > It will :)
>
> No it didn't, if you notice I replied to your original not the bump.
> It was just coincidence. An apology would have been a better response
> than that above. It is not good to antagonise those that you hope
> will help you.
>
Yes i know it was coincidence! Sorry for my answer..
>
> >> How have you setup the relationships (has_many, belongs_to etc) in
> >> your models? Or is that what you are asking how to do?
>
> > Thank you for helping me!
>
> > Shout model:
> > belongs_to :place
> > belongs_to :profile
>
> > Photo model:
> > belongs_to :place
> > belongs_to :profile
>
> > Place model:
> > has_many :photos
> > has_many :shout
>
> This should be has_many :shouts
>
>
>
> > So what i want is getting a list of these 2 models combined.
>
> > It is possible (look @http://brightkite.com/objects.xml-> also
> > created with ruby on rails)
> > <objects>
> > <photo..>
> > <note..>
> > <..>
> > </objects>
>
> > so what i want now is for
> > example:http://mybuddynetwork.info/profiles/1-admin/objects.xml
> > and i get then all the photos and shouts from that user! Same for a
> > place (all the photos and shouts at the place).
>
> If you have a place object then the photos are accessible as
> place.photos and the shouts in place.shouts. These will return arrays
> of Places and Shouts.
>
> Colin
Hey,
But this will make 2 seperate arrays or am i wrong..
i want to have place.shouts and place.photos in the same array..
so like @objects = place.photos and place.shouts (but that don't work
off course)
and then i do @objects.to_xml
How can i do this?
And thank you for helping me!
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---