On Aug 9, 2:16 pm, Mike Disuza <li...@ruby-forum.com> wrote: > Hi, > I need the "company_id" in the XML. > > render :xml=> @user will only include the user attributes. >
Is the assocation user has_one company ? If so (ie user has no company_id attribute) then the easiest thing is probably to write a method on user that returns the appropriate id and then use the :methods option to to_xml to include that in the output Fred > Thanks, > Mike > -- > 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-t...@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.