respond_to do |format| format.html # index.html.erb format.xml { render :xml => @directories } end <software>#<Software:0xb7046548></software> The model directory belongs to a software instance. -- Anthony Ettinger 408-656-2473 http://anthony.ettinger.name --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What magic were you expecting to have happen? (Rails did exactly what you told it to). Don''t you want something like format.xml { render :xml => @software.to_xml( :include => :directories ) } -- 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 -~----------~----~----~----~------~----~------~--~---
If you want only @directories, then you should create an rxml template to be used under software, where you marshall the xml data is any old format you want. for directory in @directories xml.directory do xml.directory_name(directory.name) etc etc end end -- 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 Sep 26, 9:27 am, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> If you want only @directories, then you should create an rxml template > to be used under software, where you marshall the xml data is any old > format you want. > > for directory in @directories > xml.directory do > xml.directory_name(directory.name) > etc > etc > end > end > -- > Posted viahttp://www.ruby-forum.com/.I want each directory as xml, just how it is...but the associated "software" object, I want to include that. What you wrote initially looks backwards to me. since this is requested as directories.xml <directory> .... <software version="<%= directory.software.version"><%directory.software.name %></software> </directory> It sounds like that''s the only way to create an index.rxml file? I figured there would be an automatic way to map associated models to the default xml output. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---