I'm looking to respond to XML. In my show action, I have something like this:
respond_to do |format|
format.html {
render :action => 'show'
}
format.xml {
render :xml => @post.to_xml
}
end
This will output all of the post's attributes. How would you go about outputting only some of the post's attributes. Also, say that Post belongs_to User. How would you then take this one step further by outputting the user's name with the post's XML (rather than the foreign key given to the post)?