No sorry I dont need to make a view. I have this already for shouts and photos.
I only need to find a way to make the corrent xml file like i posted already! Do i have to use XML builder to make the xml like i want? On Aug 14, 11:20 pm, Alpha Blue <rails-mailing-l...@andreas-s.net> wrote: > Colin Law wrote: > > 2009/8/14 Alpha Blue <rails-mailing-l...@andreas-s.net>: > > > It took me a little while to realise that it is not fetching the data > > that is the OPs problem but how to use to_xml to generate his xml in > > the way he wants. > > > Colin > > The problem is two fold: > > Controller > > def my_xml > @shouts = Shout.find(:all, :include => [:place, :profile]) > respond_to do |format| > format.html > format.xml { render :xml, :xml => @shouts.to_xml } > end > end > > View > > <ul> > <% for shout in @shouts-%> > <li> > <%=h shout.something %>, <%=h shout.place.something %>, <%=h > shout.profile.something %> > </li> > </ul> > > You use render to build the XML. > > However, you still need to work on associations so you can make use of > includes/joins to make just one array.. > > -- > Posted viahttp://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@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 -~----------~----~----~----~------~----~------~--~---