Created
September 26, 2010 15:28
-
-
Save uhhuhyeah/598023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
def to_xml(options={}) | |
options[:only] = [:id, :name, :other_attr] | |
super(options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of writing an xml or json view to only show the attrs I want to show, I can override the to_xml method and make a list of the attrs to show.