But I didn't want sensitive data in models to be exposed in the xml. And I also am too lazy to write custom to_xml methods for everything.
So I wrote a plugin call xml_hidden That lets you set something on the class to hide certain attributes from xml output.
class Film < ActiveRecord::Base
attr_xml_hidden :acquiring_url, :id, :created_at
end
Now whenever I output a film to xml those values can't be seen.
No comments:
Post a Comment